Average Error: 1.8 → 0.2
Time: 5.6s
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 r746238 = x;
        double r746239 = y;
        double r746240 = z;
        double r746241 = r746239 - r746240;
        double r746242 = t;
        double r746243 = r746242 - r746240;
        double r746244 = 1.0;
        double r746245 = r746243 + r746244;
        double r746246 = a;
        double r746247 = r746245 / r746246;
        double r746248 = r746241 / r746247;
        double r746249 = r746238 - r746248;
        return r746249;
}

double f(double x, double y, double z, double t, double a) {
        double r746250 = x;
        double r746251 = y;
        double r746252 = z;
        double r746253 = r746251 - r746252;
        double r746254 = t;
        double r746255 = r746254 - r746252;
        double r746256 = 1.0;
        double r746257 = r746255 + r746256;
        double r746258 = r746253 / r746257;
        double r746259 = a;
        double r746260 = r746258 * r746259;
        double r746261 = r746250 - r746260;
        return r746261;
}

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.8
Target0.2
Herbie0.2
\[x - \frac{y - z}{\left(t - z\right) + 1} \cdot a\]

Derivation

  1. Initial program 1.8

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

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

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

Reproduce

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