Average Error: 2.1 → 0.2
Time: 2.8s
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 r597264 = x;
        double r597265 = y;
        double r597266 = z;
        double r597267 = r597265 - r597266;
        double r597268 = t;
        double r597269 = r597268 - r597266;
        double r597270 = 1.0;
        double r597271 = r597269 + r597270;
        double r597272 = a;
        double r597273 = r597271 / r597272;
        double r597274 = r597267 / r597273;
        double r597275 = r597264 - r597274;
        return r597275;
}

double f(double x, double y, double z, double t, double a) {
        double r597276 = x;
        double r597277 = y;
        double r597278 = z;
        double r597279 = r597277 - r597278;
        double r597280 = t;
        double r597281 = r597280 - r597278;
        double r597282 = 1.0;
        double r597283 = r597281 + r597282;
        double r597284 = r597279 / r597283;
        double r597285 = a;
        double r597286 = r597284 * r597285;
        double r597287 = r597276 - r597286;
        return r597287;
}

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

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

Derivation

  1. Initial program 2.1

    \[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 2020081 
(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))))