Average Error: 1.9 → 1.5
Time: 3.9s
Precision: binary64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\begin{array}{l} \mathbf{if}\;t \le 4.17324296065471216 \cdot 10^{-278}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{elif}\;t \le 9.91229426843646807 \cdot 10^{-56}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{z}{\frac{t}{y}} - \frac{x}{\frac{t}{z}}\right)\\ \end{array}\]
x + \left(y - x\right) \cdot \frac{z}{t}
\begin{array}{l}
\mathbf{if}\;t \le 4.17324296065471216 \cdot 10^{-278}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\

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

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

\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 ((t <= 4.173242960654712e-278)) {
		VAR = ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
	} else {
		double VAR_1;
		if ((t <= 9.912294268436468e-56)) {
			VAR_1 = ((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t))));
		} else {
			VAR_1 = ((double) (x + ((double) (((double) (z / ((double) (t / y)))) - ((double) (x / ((double) (t / z))))))));
		}
		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.9
Target2.1
Herbie1.5
\[\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 3 regimes
  2. if t < 4.17324296065471216e-278

    1. Initial program 1.9

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

    if 4.17324296065471216e-278 < t < 9.91229426843646807e-56

    1. Initial program 4.1

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

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

    if 9.91229426843646807e-56 < t

    1. Initial program 1.0

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

      \[\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-identity1.4

      \[\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-frac1.4

      \[\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*1.3

      \[\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. Simplified1.3

      \[\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-cbrt1.3

      \[\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-prod1.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 add-cube-cbrt1.4

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

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

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

      \[\leadsto x + \color{blue}{\left(\frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \left(\sqrt[3]{z} \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}}}\right)\right)} \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{\sqrt[3]{t}}}\]
    15. Taylor expanded around 0 9.0

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

      \[\leadsto x + \color{blue}{\left(\frac{z}{\frac{t}{y}} - \frac{x}{\frac{t}{z}}\right)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le 4.17324296065471216 \cdot 10^{-278}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{elif}\;t \le 9.91229426843646807 \cdot 10^{-56}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{z}{\frac{t}{y}} - \frac{x}{\frac{t}{z}}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020184 
(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))))