Average Error: 11.1 → 1.3
Time: 4.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 r569328 = x;
        double r569329 = y;
        double r569330 = z;
        double r569331 = t;
        double r569332 = r569330 - r569331;
        double r569333 = r569329 * r569332;
        double r569334 = a;
        double r569335 = r569334 - r569331;
        double r569336 = r569333 / r569335;
        double r569337 = r569328 + r569336;
        return r569337;
}

double f(double x, double y, double z, double t, double a) {
        double r569338 = x;
        double r569339 = y;
        double r569340 = z;
        double r569341 = t;
        double r569342 = r569340 - r569341;
        double r569343 = a;
        double r569344 = r569343 - r569341;
        double r569345 = r569342 / r569344;
        double r569346 = r569339 * r569345;
        double r569347 = r569338 + r569346;
        return r569347;
}

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

Original11.1
Target1.2
Herbie1.3
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Initial program 11.1

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

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

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

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

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

Reproduce

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