As fast as electric cars are improving and expanding, there are some things that gas engines do better—many experts agree that gasoline engines will be around for several decades.

Developing electric cars and refining gas engines aren't mutually exclusive. Vehicle electrification will continue to expand rapidly, and internal combustion engines may continue well into the future, in some diminished role.

Assuming that's the case, it's a good thing that engineers are finding ways to improve the efficiency of internal combustion.

For years, gas engines were stuck at around 30 percent thermal efficiency—a measure of how much work they could do on a gallon of fuel—about a third as efficient as an electric motor (setting aside losses from power plants and transmission lines.)

Some of the best production engines in cars today have reached 40 percent thermal efficiency.

It's time to make the next jump, as this video from Engineering Explained talks about.

CHECK OUT: Here's how Mazda's HCCI engine works

The next major jump looks to come from what engineers call HCCI: homogeneous charge compression ignition. HCCI engines work on a similar principle to diesels, using the heat from compressing air in the cylinder to ignite the fuel. The trick has been to control the heat in the cylinder and thus the timing of the ignition, since pure HCCI engines don't have fuel injectors in the combustion chambers as diesels do. For example, how do you start an engine without a spark plug?

HCCI engines are promising because, like diesels, they run on a leaner mixture of air-to-fuel, using less gas, and they use very high compression ratios, which also improve efficiency.

DON'T MISS: 2020 Mazda 3 prototype first drive: can spark-less engines ignite our passions?

Mazda has announced that it will introduce a version of an HCCI that it calls Skyactiv-X will go into production in 2019. Skyactiv-X uses a spark plug and Mazda's patented processes to control ignition timing while reaping the benefits of HCCI's high compression and lean burn.

Several journalists, including our colleagues at Motor Authority have driven prototypes of the engine, and have come away impressed.

Mazda claims a 30-percent improvement in efficiency compared with its current production line of Skyactiv-G gasoline engines.

Mazda 2.0-liter SkyActiv-X engine with spark-controlled compression ignition (SPCCI)

Mazda 2.0-liter SkyActiv-X engine with spark-controlled compression ignition (SPCCI)

Now researchers at the University of Wisconsin are trying to do Mazda one better: They've developed a dual-fuel HCCI engine that runs mostly on gasoline using compression ignition, and partly—when the engine is cold or at low loads—on diesel fuel.

The researchers claim their reactivity controlled compression ignition (RCCI) engine has hit 60 percent thermal efficiency on the test bench, which would represent about a 50-percent improvement over the best modern engines.

Since diesel fuel is much easier to ignite than gasoline, the RCCI engine uses diesel when the engine is cold or the load is low. With very high compression and low temperatures, it avoids most of diesel's problems with emissions of nitrogen oxides and particulates. The engine meets 2015 EPA emissions requirements for diesels without the need for the exhaust after-treatment that current diesels require.

When loads are high and the engine is warm, it uses mainly gasoline, which runs clean even under those conditions.

DON'T MISS: Mazda gets California approval for CX-5 diesel

Like Mazda's Skyactiv-X, the RCCI engine uses a spark plug to control ignition timing. It uses diesel fuel to take advantage of a leaner mixture when possible, and mixes gasoline and diesel in the combustion chamber, and constantly adjusts the mixture to achieve maximum efficiency.

What's the downside? Mainly the need for two separate fuel tanks that drivers will have to keep track of and fill.

These types of efficient engines may be key to raising efficiency of trucks that have to do heavy work and don't spend the time sitting to refill that electric cars need (and most cars have.) The technologies could even be combined with hybrid systems to boost efficiency even further.