Average Error: 2.2 → 0.3
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 r775956 = x;
        double r775957 = y;
        double r775958 = z;
        double r775959 = r775957 - r775958;
        double r775960 = t;
        double r775961 = r775960 - r775958;
        double r775962 = 1.0;
        double r775963 = r775961 + r775962;
        double r775964 = a;
        double r775965 = r775963 / r775964;
        double r775966 = r775959 / r775965;
        double r775967 = r775956 - r775966;
        return r775967;
}

double f(double x, double y, double z, double t, double a) {
        double r775968 = x;
        double r775969 = y;
        double r775970 = z;
        double r775971 = r775969 - r775970;
        double r775972 = t;
        double r775973 = r775972 - r775970;
        double r775974 = 1.0;
        double r775975 = r775973 + r775974;
        double r775976 = r775971 / r775975;
        double r775977 = a;
        double r775978 = r775976 * r775977;
        double r775979 = r775968 - r775978;
        return r775979;
}

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

Derivation

  1. Initial program 2.2

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