Average Error: 1.9 → 0.3
Time: 10.0s
Precision: 64
\[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\]
\[x - \frac{y - z}{\left(t - z\right) + 1} \cdot a\]
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
double f(double x, double y, double z, double t, double a) {
        double r308290 = x;
        double r308291 = y;
        double r308292 = z;
        double r308293 = r308291 - r308292;
        double r308294 = t;
        double r308295 = r308294 - r308292;
        double r308296 = 1.0;
        double r308297 = r308295 + r308296;
        double r308298 = a;
        double r308299 = r308297 / r308298;
        double r308300 = r308293 / r308299;
        double r308301 = r308290 - r308300;
        return r308301;
}

double f(double x, double y, double z, double t, double a) {
        double r308302 = x;
        double r308303 = y;
        double r308304 = z;
        double r308305 = r308303 - r308304;
        double r308306 = t;
        double r308307 = r308306 - r308304;
        double r308308 = 1.0;
        double r308309 = r308307 + r308308;
        double r308310 = r308305 / r308309;
        double r308311 = a;
        double r308312 = r308310 * r308311;
        double r308313 = r308302 - r308312;
        return r308313;
}

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

Original1.9
Target0.3
Herbie0.3
\[x - \frac{y - z}{\left(t - z\right) + 1} \cdot a\]

Derivation

  1. Initial program 1.9

    \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\]
  2. Using strategy rm
  3. Applied associate-/r/0.3

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

    \[\leadsto x - \frac{y - z}{\left(t - z\right) + 1} \cdot a\]

Reproduce

herbie shell --seed 2020042 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (- x (* (/ (- y z) (+ (- t z) 1)) a))

  (- x (/ (- y z) (/ (+ (- t z) 1) a))))