Average Error: 6.6 → 1.0
Time: 16.7s
Precision: 64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{\left(z - x\right) \cdot y}{t} \le -1.965083146290500614286341897407845344146 \cdot 10^{301}:\\ \;\;\;\;\frac{1}{\frac{\frac{t}{y}}{z - x}} + x\\ \mathbf{elif}\;x + \frac{\left(z - x\right) \cdot y}{t} \le 3.04632394684078922300073031209134710354 \cdot 10^{288}:\\ \;\;\;\;x + \frac{\left(z - x\right) \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{t}{y}}{z - x}} + x\\ \end{array}\]
x + \frac{y \cdot \left(z - x\right)}{t}
\begin{array}{l}
\mathbf{if}\;x + \frac{\left(z - x\right) \cdot y}{t} \le -1.965083146290500614286341897407845344146 \cdot 10^{301}:\\
\;\;\;\;\frac{1}{\frac{\frac{t}{y}}{z - x}} + x\\

\mathbf{elif}\;x + \frac{\left(z - x\right) \cdot y}{t} \le 3.04632394684078922300073031209134710354 \cdot 10^{288}:\\
\;\;\;\;x + \frac{\left(z - x\right) \cdot y}{t}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\frac{t}{y}}{z - x}} + x\\

\end{array}
double f(double x, double y, double z, double t) {
        double r15359831 = x;
        double r15359832 = y;
        double r15359833 = z;
        double r15359834 = r15359833 - r15359831;
        double r15359835 = r15359832 * r15359834;
        double r15359836 = t;
        double r15359837 = r15359835 / r15359836;
        double r15359838 = r15359831 + r15359837;
        return r15359838;
}

double f(double x, double y, double z, double t) {
        double r15359839 = x;
        double r15359840 = z;
        double r15359841 = r15359840 - r15359839;
        double r15359842 = y;
        double r15359843 = r15359841 * r15359842;
        double r15359844 = t;
        double r15359845 = r15359843 / r15359844;
        double r15359846 = r15359839 + r15359845;
        double r15359847 = -1.9650831462905006e+301;
        bool r15359848 = r15359846 <= r15359847;
        double r15359849 = 1.0;
        double r15359850 = r15359844 / r15359842;
        double r15359851 = r15359850 / r15359841;
        double r15359852 = r15359849 / r15359851;
        double r15359853 = r15359852 + r15359839;
        double r15359854 = 3.046323946840789e+288;
        bool r15359855 = r15359846 <= r15359854;
        double r15359856 = r15359855 ? r15359846 : r15359853;
        double r15359857 = r15359848 ? r15359853 : r15359856;
        return r15359857;
}

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

Derivation

  1. Split input into 2 regimes
  2. if (+ x (/ (* y (- z x)) t)) < -1.9650831462905006e+301 or 3.046323946840789e+288 < (+ x (/ (* y (- z x)) t))

    1. Initial program 50.6

      \[x + \frac{y \cdot \left(z - x\right)}{t}\]
    2. Using strategy rm
    3. Applied clear-num50.6

      \[\leadsto x + \color{blue}{\frac{1}{\frac{t}{y \cdot \left(z - x\right)}}}\]
    4. Using strategy rm
    5. Applied associate-/r*2.0

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

    if -1.9650831462905006e+301 < (+ x (/ (* y (- z x)) t)) < 3.046323946840789e+288

    1. Initial program 0.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(z - x\right) \cdot y}{t} \le -1.965083146290500614286341897407845344146 \cdot 10^{301}:\\ \;\;\;\;\frac{1}{\frac{\frac{t}{y}}{z - x}} + x\\ \mathbf{elif}\;x + \frac{\left(z - x\right) \cdot y}{t} \le 3.04632394684078922300073031209134710354 \cdot 10^{288}:\\ \;\;\;\;x + \frac{\left(z - x\right) \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{t}{y}}{z - x}} + x\\ \end{array}\]

Reproduce

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

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

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