Average Error: 6.0 → 6.0
Time: 10.7s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a}\]
\[x + \frac{y \cdot \left(z - t\right)}{a}\]
x + \frac{y \cdot \left(z - t\right)}{a}
x + \frac{y \cdot \left(z - t\right)}{a}
double f(double x, double y, double z, double t, double a) {
        double r276992 = x;
        double r276993 = y;
        double r276994 = z;
        double r276995 = t;
        double r276996 = r276994 - r276995;
        double r276997 = r276993 * r276996;
        double r276998 = a;
        double r276999 = r276997 / r276998;
        double r277000 = r276992 + r276999;
        return r277000;
}

double f(double x, double y, double z, double t, double a) {
        double r277001 = x;
        double r277002 = y;
        double r277003 = z;
        double r277004 = t;
        double r277005 = r277003 - r277004;
        double r277006 = r277002 * r277005;
        double r277007 = a;
        double r277008 = r277006 / r277007;
        double r277009 = r277001 + r277008;
        return r277009;
}

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

Original6.0
Target0.7
Herbie6.0
\[\begin{array}{l} \mathbf{if}\;y \lt -1.07612662163899753216593153715602325729 \cdot 10^{-10}:\\ \;\;\;\;x + \frac{1}{\frac{\frac{a}{z - t}}{y}}\\ \mathbf{elif}\;y \lt 2.894426862792089097262541964056085749132 \cdot 10^{-49}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if a < -5.0795419802356836e-45 or 7.486812957945773e-52 < a

    1. Initial program 8.3

      \[x + \frac{y \cdot \left(z - t\right)}{a}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity8.3

      \[\leadsto x + \frac{y \cdot \left(z - t\right)}{\color{blue}{1 \cdot a}}\]
    4. Applied times-frac0.9

      \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{z - t}{a}}\]
    5. Simplified0.9

      \[\leadsto x + \color{blue}{y} \cdot \frac{z - t}{a}\]

    if -5.0795419802356836e-45 < a < 7.486812957945773e-52

    1. Initial program 0.9

      \[x + \frac{y \cdot \left(z - t\right)}{a}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification6.0

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

Reproduce

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

  :herbie-target
  (if (< y -1.07612662163899753e-10) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2.8944268627920891e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))

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