Average Error: 6.6 → 2.0
Time: 19.7s
Precision: 64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[x + \frac{z - x}{\frac{t}{y}}\]
x + \frac{y \cdot \left(z - x\right)}{t}
x + \frac{z - x}{\frac{t}{y}}
double f(double x, double y, double z, double t) {
        double r251252 = x;
        double r251253 = y;
        double r251254 = z;
        double r251255 = r251254 - r251252;
        double r251256 = r251253 * r251255;
        double r251257 = t;
        double r251258 = r251256 / r251257;
        double r251259 = r251252 + r251258;
        return r251259;
}

double f(double x, double y, double z, double t) {
        double r251260 = x;
        double r251261 = z;
        double r251262 = r251261 - r251260;
        double r251263 = t;
        double r251264 = y;
        double r251265 = r251263 / r251264;
        double r251266 = r251262 / r251265;
        double r251267 = r251260 + r251266;
        return r251267;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.6
Target2.1
Herbie2.0
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)\]

Derivation

  1. Initial program 6.6

    \[x + \frac{y \cdot \left(z - x\right)}{t}\]
  2. Using strategy rm
  3. Applied associate-/l*6.1

    \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}}\]
  4. Using strategy rm
  5. Applied associate-/r/2.1

    \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)}\]
  6. Taylor expanded around 0 6.6

    \[\leadsto x + \color{blue}{\left(\frac{z \cdot y}{t} - \frac{x \cdot y}{t}\right)}\]
  7. Simplified2.0

    \[\leadsto x + \color{blue}{\frac{z - x}{\frac{t}{y}}}\]
  8. Final simplification2.0

    \[\leadsto x + \frac{z - x}{\frac{t}{y}}\]

Reproduce

herbie shell --seed 2019325 
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
  :precision binary64

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

  (+ x (/ (* y (- z x)) t)))