Average Error: 10.8 → 1.5
Time: 16.9s
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 r398950 = x;
        double r398951 = y;
        double r398952 = z;
        double r398953 = t;
        double r398954 = r398952 - r398953;
        double r398955 = r398951 * r398954;
        double r398956 = a;
        double r398957 = r398956 - r398953;
        double r398958 = r398955 / r398957;
        double r398959 = r398950 + r398958;
        return r398959;
}

double f(double x, double y, double z, double t, double a) {
        double r398960 = x;
        double r398961 = y;
        double r398962 = z;
        double r398963 = t;
        double r398964 = r398962 - r398963;
        double r398965 = a;
        double r398966 = r398965 - r398963;
        double r398967 = r398964 / r398966;
        double r398968 = r398961 * r398967;
        double r398969 = r398960 + r398968;
        return r398969;
}

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.5
\[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.5

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

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

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

Reproduce

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