Average Error: 10.8 → 1.6
Time: 9.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 r517088 = x;
        double r517089 = y;
        double r517090 = z;
        double r517091 = t;
        double r517092 = r517090 - r517091;
        double r517093 = r517089 * r517092;
        double r517094 = a;
        double r517095 = r517094 - r517091;
        double r517096 = r517093 / r517095;
        double r517097 = r517088 + r517096;
        return r517097;
}

double f(double x, double y, double z, double t, double a) {
        double r517098 = x;
        double r517099 = y;
        double r517100 = z;
        double r517101 = t;
        double r517102 = r517100 - r517101;
        double r517103 = a;
        double r517104 = r517103 - r517101;
        double r517105 = r517102 / r517104;
        double r517106 = r517099 * r517105;
        double r517107 = r517098 + r517106;
        return r517107;
}

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 +o rules:numerics
(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))))