Average Error: 6.0 → 6.0
Time: 5.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 r199880 = x;
        double r199881 = y;
        double r199882 = z;
        double r199883 = t;
        double r199884 = r199882 - r199883;
        double r199885 = r199881 * r199884;
        double r199886 = a;
        double r199887 = r199885 / r199886;
        double r199888 = r199880 - r199887;
        return r199888;
}

double f(double x, double y, double z, double t, double a) {
        double r199889 = x;
        double r199890 = y;
        double r199891 = z;
        double r199892 = t;
        double r199893 = r199891 - r199892;
        double r199894 = r199890 * r199893;
        double r199895 = a;
        double r199896 = r199894 / r199895;
        double r199897 = r199889 - r199896;
        return r199897;
}

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 (* y (- z t)) < -5.119477841408171e+134 or 2.6633185285567248e+296 < (* y (- z t))

    1. Initial program 28.8

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

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

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

    if -5.119477841408171e+134 < (* y (- z t)) < 2.6633185285567248e+296

    1. Initial program 0.4

      \[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 2019304 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
  :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)))