Average Error: 1.2 → 1.1
Time: 3.2s
Precision: binary64
\[x + \left(y - x\right) \cdot \frac{z}{t} \]
\[\begin{array}{l} t_1 := \sqrt[3]{y - x}\\ x + \left(z \cdot \frac{t_1 \cdot t_1}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right) \cdot \frac{t_1}{\sqrt[3]{t}} \end{array} \]
x + \left(y - x\right) \cdot \frac{z}{t}
\begin{array}{l}
t_1 := \sqrt[3]{y - x}\\
x + \left(z \cdot \frac{t_1 \cdot t_1}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right) \cdot \frac{t_1}{\sqrt[3]{t}}
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (* (- y x) (/ z t))))
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (cbrt (- y x))))
   (+ x (* (* z (/ (* t_1 t_1) (* (cbrt t) (cbrt t)))) (/ t_1 (cbrt t))))))
double code(double x, double y, double z, double t) {
	return x + ((y - x) * (z / t));
}
double code(double x, double y, double z, double t) {
	double t_1 = cbrt(y - x);
	return x + ((z * ((t_1 * t_1) / (cbrt(t) * cbrt(t)))) * (t_1 / cbrt(t)));
}

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.2
Target1.4
Herbie1.1
\[\begin{array}{l} \mathbf{if}\;\left(y - x\right) \cdot \frac{z}{t} < -1013646692435.8867:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \mathbf{elif}\;\left(y - x\right) \cdot \frac{z}{t} < 0:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array} \]

Derivation

  1. Initial program 1.2

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
  3. Applied fma-udef_binary641.2

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

    \[\leadsto \color{blue}{z \cdot \frac{y - x}{t}} + x \]
  5. Applied add-cube-cbrt_binary644.8

    \[\leadsto z \cdot \frac{y - x}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}} + x \]
  6. Applied add-cube-cbrt_binary644.9

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

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

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

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

Reproduce

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