Average Error: 1.8 → 1.9
Time: 4.0s
Precision: binary64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\begin{array}{l} \mathbf{if}\;x \le -2.05755293214129969 \cdot 10^{-91}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{elif}\;x \le -2.5031652597621486 \cdot 10^{-269}:\\ \;\;\;\;x + \frac{\frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}}}{\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \frac{z}{\sqrt[3]{\sqrt[3]{t}}}\\ \mathbf{elif}\;x \le 5.97114501302377272 \cdot 10^{-245}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{elif}\;x \le 8.2799812652679555 \cdot 10^{-175}:\\ \;\;\;\;x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\\ \mathbf{elif}\;x \le 2.3622199036016316 \cdot 10^{-160}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \end{array}\]
x + \left(y - x\right) \cdot \frac{z}{t}
\begin{array}{l}
\mathbf{if}\;x \le -2.05755293214129969 \cdot 10^{-91}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\

\mathbf{elif}\;x \le -2.5031652597621486 \cdot 10^{-269}:\\
\;\;\;\;x + \frac{\frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}}}{\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \frac{z}{\sqrt[3]{\sqrt[3]{t}}}\\

\mathbf{elif}\;x \le 5.97114501302377272 \cdot 10^{-245}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\

\mathbf{elif}\;x \le 8.2799812652679555 \cdot 10^{-175}:\\
\;\;\;\;x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\\

\mathbf{elif}\;x \le 2.3622199036016316 \cdot 10^{-160}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\

\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((x <= -2.0575529321412997e-91)) {
		VAR = ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
	} else {
		double VAR_1;
		if ((x <= -2.5031652597621486e-269)) {
			VAR_1 = ((double) (x + ((double) (((double) (((double) (((double) (y - x)) / ((double) (((double) cbrt(t)) * ((double) cbrt(t)))))) / ((double) cbrt(((double) (((double) cbrt(t)) * ((double) cbrt(t)))))))) * ((double) (z / ((double) cbrt(((double) cbrt(t))))))))));
		} else {
			double VAR_2;
			if ((x <= 5.971145013023773e-245)) {
				VAR_2 = ((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t))));
			} else {
				double VAR_3;
				if ((x <= 8.279981265267956e-175)) {
					VAR_3 = ((double) (x + ((double) (((double) (((double) (y - x)) / ((double) (((double) cbrt(t)) * ((double) cbrt(t)))))) * ((double) (z / ((double) cbrt(t))))))));
				} else {
					double VAR_4;
					if ((x <= 2.3622199036016316e-160)) {
						VAR_4 = ((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t))));
					} else {
						VAR_4 = ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
					}
					VAR_3 = VAR_4;
				}
				VAR_2 = VAR_3;
			}
			VAR_1 = VAR_2;
		}
		VAR = VAR_1;
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.8
Target2.0
Herbie1.9
\[\begin{array}{l} \mathbf{if}\;\left(y - x\right) \cdot \frac{z}{t} \lt -1013646692435.887:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \mathbf{elif}\;\left(y - x\right) \cdot \frac{z}{t} \lt -0.0:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array}\]

Derivation

  1. Split input into 4 regimes
  2. if x < -2.05755293214129969e-91 or 2.3622199036016316e-160 < x

    1. Initial program 0.6

      \[x + \left(y - x\right) \cdot \frac{z}{t}\]

    if -2.05755293214129969e-91 < x < -2.5031652597621486e-269

    1. Initial program 3.6

      \[x + \left(y - x\right) \cdot \frac{z}{t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt4.2

      \[\leadsto x + \left(y - x\right) \cdot \frac{z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}\]
    4. Applied *-un-lft-identity4.2

      \[\leadsto x + \left(y - x\right) \cdot \frac{\color{blue}{1 \cdot z}}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}\]
    5. Applied times-frac4.2

      \[\leadsto x + \left(y - x\right) \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\right)}\]
    6. Applied associate-*r*3.2

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right) \cdot \frac{z}{\sqrt[3]{t}}}\]
    7. Simplified3.2

      \[\leadsto x + \color{blue}{\frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \frac{z}{\sqrt[3]{t}}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt3.2

      \[\leadsto x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}}\]
    10. Applied cbrt-prod3.3

      \[\leadsto x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\color{blue}{\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \sqrt[3]{\sqrt[3]{t}}}}\]
    11. Applied *-un-lft-identity3.3

      \[\leadsto x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{1 \cdot z}}{\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \sqrt[3]{\sqrt[3]{t}}}\]
    12. Applied times-frac3.3

      \[\leadsto x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \frac{z}{\sqrt[3]{\sqrt[3]{t}}}\right)}\]
    13. Applied associate-*r*4.6

      \[\leadsto x + \color{blue}{\left(\frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{1}{\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}}}\right) \cdot \frac{z}{\sqrt[3]{\sqrt[3]{t}}}}\]
    14. Simplified4.6

      \[\leadsto x + \color{blue}{\frac{\frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}}}{\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}}}} \cdot \frac{z}{\sqrt[3]{\sqrt[3]{t}}}\]

    if -2.5031652597621486e-269 < x < 5.97114501302377272e-245 or 8.2799812652679555e-175 < x < 2.3622199036016316e-160

    1. Initial program 5.3

      \[x + \left(y - x\right) \cdot \frac{z}{t}\]
    2. Using strategy rm
    3. Applied associate-*r/5.3

      \[\leadsto x + \color{blue}{\frac{\left(y - x\right) \cdot z}{t}}\]

    if 5.97114501302377272e-245 < x < 8.2799812652679555e-175

    1. Initial program 4.3

      \[x + \left(y - x\right) \cdot \frac{z}{t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt5.0

      \[\leadsto x + \left(y - x\right) \cdot \frac{z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}\]
    4. Applied *-un-lft-identity5.0

      \[\leadsto x + \left(y - x\right) \cdot \frac{\color{blue}{1 \cdot z}}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}\]
    5. Applied times-frac5.1

      \[\leadsto x + \left(y - x\right) \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\right)}\]
    6. Applied associate-*r*3.0

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right) \cdot \frac{z}{\sqrt[3]{t}}}\]
    7. Simplified3.0

      \[\leadsto x + \color{blue}{\frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \frac{z}{\sqrt[3]{t}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification1.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -2.05755293214129969 \cdot 10^{-91}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{elif}\;x \le -2.5031652597621486 \cdot 10^{-269}:\\ \;\;\;\;x + \frac{\frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}}}{\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \frac{z}{\sqrt[3]{\sqrt[3]{t}}}\\ \mathbf{elif}\;x \le 5.97114501302377272 \cdot 10^{-245}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{elif}\;x \le 8.2799812652679555 \cdot 10^{-175}:\\ \;\;\;\;x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\\ \mathbf{elif}\;x \le 2.3622199036016316 \cdot 10^{-160}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \end{array}\]

Reproduce

herbie shell --seed 2020149 
(FPCore (x y z t)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
  :precision binary64

  :herbie-target
  (if (< (* (- y x) (/ z t)) -1013646692435.8867) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) -0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))

  (+ x (* (- y x) (/ z t))))