Average Error: 10.8 → 1.6
Time: 9.7s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[x + y \cdot \frac{z - t}{a - t}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
x + y \cdot \frac{z - t}{a - t}
double f(double x, double y, double z, double t, double a) {
        double r532352 = x;
        double r532353 = y;
        double r532354 = z;
        double r532355 = t;
        double r532356 = r532354 - r532355;
        double r532357 = r532353 * r532356;
        double r532358 = a;
        double r532359 = r532358 - r532355;
        double r532360 = r532357 / r532359;
        double r532361 = r532352 + r532360;
        return r532361;
}

double f(double x, double y, double z, double t, double a) {
        double r532362 = x;
        double r532363 = y;
        double r532364 = z;
        double r532365 = t;
        double r532366 = r532364 - r532365;
        double r532367 = a;
        double r532368 = r532367 - r532365;
        double r532369 = r532366 / r532368;
        double r532370 = r532363 * r532369;
        double r532371 = r532362 + r532370;
        return r532371;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.8
Target1.4
Herbie1.6
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Initial program 10.8

    \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity10.8

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

    \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{z - t}{a - t}}\]
  5. Simplified1.6

    \[\leadsto x + \color{blue}{y} \cdot \frac{z - t}{a - t}\]
  6. Final simplification1.6

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

Reproduce

herbie shell --seed 2020045 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (+ x (/ y (/ (- a t) (- z t))))

  (+ x (/ (* y (- z t)) (- a t))))