Average Error: 10.6 → 1.4
Time: 6.3s
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 r608709 = x;
        double r608710 = y;
        double r608711 = z;
        double r608712 = t;
        double r608713 = r608711 - r608712;
        double r608714 = r608710 * r608713;
        double r608715 = a;
        double r608716 = r608715 - r608712;
        double r608717 = r608714 / r608716;
        double r608718 = r608709 + r608717;
        return r608718;
}

double f(double x, double y, double z, double t, double a) {
        double r608719 = x;
        double r608720 = y;
        double r608721 = z;
        double r608722 = t;
        double r608723 = r608721 - r608722;
        double r608724 = a;
        double r608725 = r608724 - r608722;
        double r608726 = r608723 / r608725;
        double r608727 = r608720 * r608726;
        double r608728 = r608719 + r608727;
        return r608728;
}

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

Derivation

  1. Initial program 10.6

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

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

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

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

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

Reproduce

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