Average Error: 6.5 → 2.0
Time: 15.7s
Precision: 64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[\left(z - x\right) \cdot \frac{y}{t} + x\]
x + \frac{y \cdot \left(z - x\right)}{t}
\left(z - x\right) \cdot \frac{y}{t} + x
double f(double x, double y, double z, double t) {
        double r381005 = x;
        double r381006 = y;
        double r381007 = z;
        double r381008 = r381007 - r381005;
        double r381009 = r381006 * r381008;
        double r381010 = t;
        double r381011 = r381009 / r381010;
        double r381012 = r381005 + r381011;
        return r381012;
}

double f(double x, double y, double z, double t) {
        double r381013 = z;
        double r381014 = x;
        double r381015 = r381013 - r381014;
        double r381016 = y;
        double r381017 = t;
        double r381018 = r381016 / r381017;
        double r381019 = r381015 * r381018;
        double r381020 = r381019 + r381014;
        return r381020;
}

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.5
Target2.0
Herbie2.0
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)\]

Derivation

  1. Initial program 6.5

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)}\]
  3. Using strategy rm
  4. Applied fma-udef2.0

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

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

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

Reproduce

herbie shell --seed 2019351 +o rules:numerics
(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)))