Average Error: 2.0 → 1.9
Time: 5.2s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\frac{y - x}{\frac{t}{z}} + x\]
x + \left(y - x\right) \cdot \frac{z}{t}
\frac{y - x}{\frac{t}{z}} + x
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) {
	return (((y - x) / (t / z)) + x);
}

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

Original2.0
Target2.2
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. Initial program 2.0

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

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

    \[\leadsto x + \color{blue}{\left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\sqrt[3]{y - x} \cdot \frac{z}{t}\right)}\]
  5. Using strategy rm
  6. Applied associate-*l*2.5

    \[\leadsto x + \color{blue}{\sqrt[3]{y - x} \cdot \left(\sqrt[3]{y - x} \cdot \left(\sqrt[3]{y - x} \cdot \frac{z}{t}\right)\right)}\]
  7. Using strategy rm
  8. Applied associate-*r/2.9

    \[\leadsto x + \sqrt[3]{y - x} \cdot \left(\sqrt[3]{y - x} \cdot \color{blue}{\frac{\sqrt[3]{y - x} \cdot z}{t}}\right)\]
  9. Using strategy rm
  10. Applied pow12.9

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

    \[\leadsto x + \sqrt[3]{y - x} \cdot \left(\color{blue}{{\left(\sqrt[3]{y - x}\right)}^{1}} \cdot {\left(\frac{\sqrt[3]{y - x} \cdot z}{t}\right)}^{1}\right)\]
  12. Applied pow-prod-down2.9

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

    \[\leadsto x + \color{blue}{{\left(\sqrt[3]{y - x}\right)}^{1}} \cdot {\left(\sqrt[3]{y - x} \cdot \frac{\sqrt[3]{y - x} \cdot z}{t}\right)}^{1}\]
  14. Applied pow-prod-down2.9

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

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

    \[\leadsto \frac{y - x}{\frac{t}{z}} + x\]

Reproduce

herbie shell --seed 2020058 +o rules:numerics
(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.887) (+ 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))))