Average Error: 2.0 → 6.6
Time: 6.6s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\frac{z \cdot \left(y - x\right)}{t} - \left(-x\right)\]
x + \left(y - x\right) \cdot \frac{z}{t}
\frac{z \cdot \left(y - x\right)}{t} - \left(-x\right)
double f(double x, double y, double z, double t) {
        double r384470 = x;
        double r384471 = y;
        double r384472 = r384471 - r384470;
        double r384473 = z;
        double r384474 = t;
        double r384475 = r384473 / r384474;
        double r384476 = r384472 * r384475;
        double r384477 = r384470 + r384476;
        return r384477;
}

double f(double x, double y, double z, double t) {
        double r384478 = z;
        double r384479 = y;
        double r384480 = x;
        double r384481 = r384479 - r384480;
        double r384482 = r384478 * r384481;
        double r384483 = t;
        double r384484 = r384482 / r384483;
        double r384485 = -r384480;
        double r384486 = r384484 - r384485;
        return r384486;
}

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.1
Herbie6.6
\[\begin{array}{l} \mathbf{if}\;\left(y - x\right) \cdot \frac{z}{t} \lt -1013646692435.88671875:\\ \;\;\;\;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 + \left(y - x\right) \cdot \frac{z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}\]
  4. Applied add-cube-cbrt2.6

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

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

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

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

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

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

Reproduce

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