Average Error: 6.5 → 1.8
Time: 55.9s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a}\]
\[\begin{array}{l} \mathbf{if}\;a \le -1.7970758753613627 \cdot 10^{+105}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;a \le 1.2591825253525602 \cdot 10^{-146}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{a} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{z - t}{\sqrt[3]{a}} + x\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a}
\begin{array}{l}
\mathbf{if}\;a \le -1.7970758753613627 \cdot 10^{+105}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{y}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{z - t}{\sqrt[3]{a}} + x\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r20923417 = x;
        double r20923418 = y;
        double r20923419 = z;
        double r20923420 = t;
        double r20923421 = r20923419 - r20923420;
        double r20923422 = r20923418 * r20923421;
        double r20923423 = a;
        double r20923424 = r20923422 / r20923423;
        double r20923425 = r20923417 + r20923424;
        return r20923425;
}

double f(double x, double y, double z, double t, double a) {
        double r20923426 = a;
        double r20923427 = -1.7970758753613627e+105;
        bool r20923428 = r20923426 <= r20923427;
        double r20923429 = x;
        double r20923430 = y;
        double r20923431 = z;
        double r20923432 = t;
        double r20923433 = r20923431 - r20923432;
        double r20923434 = r20923433 / r20923426;
        double r20923435 = r20923430 * r20923434;
        double r20923436 = r20923429 + r20923435;
        double r20923437 = 1.2591825253525602e-146;
        bool r20923438 = r20923426 <= r20923437;
        double r20923439 = r20923433 * r20923430;
        double r20923440 = r20923439 / r20923426;
        double r20923441 = r20923440 + r20923429;
        double r20923442 = cbrt(r20923426);
        double r20923443 = r20923442 * r20923442;
        double r20923444 = r20923430 / r20923443;
        double r20923445 = r20923433 / r20923442;
        double r20923446 = r20923444 * r20923445;
        double r20923447 = r20923446 + r20923429;
        double r20923448 = r20923438 ? r20923441 : r20923447;
        double r20923449 = r20923428 ? r20923436 : r20923448;
        return r20923449;
}

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.5
Target0.6
Herbie1.8
\[\begin{array}{l} \mathbf{if}\;y \lt -1.0761266216389975 \cdot 10^{-10}:\\ \;\;\;\;x + \frac{1.0}{\frac{\frac{a}{z - t}}{y}}\\ \mathbf{elif}\;y \lt 2.894426862792089 \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 3 regimes
  2. if a < -1.7970758753613627e+105

    1. Initial program 11.8

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

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

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

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

    if -1.7970758753613627e+105 < a < 1.2591825253525602e-146

    1. Initial program 2.2

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

    if 1.2591825253525602e-146 < a

    1. Initial program 7.5

      \[x + \frac{y \cdot \left(z - t\right)}{a}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt7.9

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

      \[\leadsto x + \color{blue}{\frac{y}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{z - t}{\sqrt[3]{a}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -1.7970758753613627 \cdot 10^{+105}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;a \le 1.2591825253525602 \cdot 10^{-146}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{a} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{z - t}{\sqrt[3]{a}} + x\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< y -1.0761266216389975e-10) (+ x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))

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