Average Error: 2.2 → 2.1
Time: 22.4s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[x + \frac{1}{\frac{\frac{t}{z}}{y - x}}\]
x + \left(y - x\right) \cdot \frac{z}{t}
x + \frac{1}{\frac{\frac{t}{z}}{y - x}}
double f(double x, double y, double z, double t) {
        double r499530 = x;
        double r499531 = y;
        double r499532 = r499531 - r499530;
        double r499533 = z;
        double r499534 = t;
        double r499535 = r499533 / r499534;
        double r499536 = r499532 * r499535;
        double r499537 = r499530 + r499536;
        return r499537;
}

double f(double x, double y, double z, double t) {
        double r499538 = x;
        double r499539 = 1.0;
        double r499540 = t;
        double r499541 = z;
        double r499542 = r499540 / r499541;
        double r499543 = y;
        double r499544 = r499543 - r499538;
        double r499545 = r499542 / r499544;
        double r499546 = r499539 / r499545;
        double r499547 = r499538 + r499546;
        return r499547;
}

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.2
Target2.3
Herbie2.1
\[\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.2

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

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

    \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
  6. Using strategy rm
  7. Applied clear-num2.1

    \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{t}{z}}{y - x}}}\]
  8. Final simplification2.1

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

Reproduce

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