Average Error: 10.4 → 1.2
Time: 15.0s
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 r358571 = x;
        double r358572 = y;
        double r358573 = z;
        double r358574 = t;
        double r358575 = r358573 - r358574;
        double r358576 = r358572 * r358575;
        double r358577 = a;
        double r358578 = r358577 - r358574;
        double r358579 = r358576 / r358578;
        double r358580 = r358571 + r358579;
        return r358580;
}

double f(double x, double y, double z, double t, double a) {
        double r358581 = x;
        double r358582 = y;
        double r358583 = z;
        double r358584 = t;
        double r358585 = r358583 - r358584;
        double r358586 = a;
        double r358587 = r358586 - r358584;
        double r358588 = r358585 / r358587;
        double r358589 = r358582 * r358588;
        double r358590 = r358581 + r358589;
        return r358590;
}

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.4
Target1.1
Herbie1.2
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Initial program 10.4

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

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

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

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

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

Reproduce

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