Average Error: 10.8 → 1.3
Time: 3.5s
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 r559143 = x;
        double r559144 = y;
        double r559145 = z;
        double r559146 = t;
        double r559147 = r559145 - r559146;
        double r559148 = r559144 * r559147;
        double r559149 = a;
        double r559150 = r559149 - r559146;
        double r559151 = r559148 / r559150;
        double r559152 = r559143 + r559151;
        return r559152;
}

double f(double x, double y, double z, double t, double a) {
        double r559153 = x;
        double r559154 = y;
        double r559155 = z;
        double r559156 = t;
        double r559157 = r559155 - r559156;
        double r559158 = a;
        double r559159 = r559158 - r559156;
        double r559160 = r559157 / r559159;
        double r559161 = r559154 * r559160;
        double r559162 = r559153 + r559161;
        return r559162;
}

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.2
Herbie1.3
\[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.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 2020046 
(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))))