Average Error: 5.9 → 1.2
Time: 9.4s
Precision: 64
\[x - \frac{y \cdot \left(z - t\right)}{a}\]
\[\begin{array}{l} \mathbf{if}\;a \le -1.39950285805274381 \cdot 10^{104}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\ \mathbf{elif}\;a \le 3.75740059193433464 \cdot 10^{65}:\\ \;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{z - t}{a}\\ \end{array}\]
x - \frac{y \cdot \left(z - t\right)}{a}
\begin{array}{l}
\mathbf{if}\;a \le -1.39950285805274381 \cdot 10^{104}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\

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

\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z - t}{a}\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r279483 = x;
        double r279484 = y;
        double r279485 = z;
        double r279486 = t;
        double r279487 = r279485 - r279486;
        double r279488 = r279484 * r279487;
        double r279489 = a;
        double r279490 = r279488 / r279489;
        double r279491 = r279483 - r279490;
        return r279491;
}

double f(double x, double y, double z, double t, double a) {
        double r279492 = a;
        double r279493 = -1.3995028580527438e+104;
        bool r279494 = r279492 <= r279493;
        double r279495 = x;
        double r279496 = y;
        double r279497 = z;
        double r279498 = t;
        double r279499 = r279497 - r279498;
        double r279500 = r279492 / r279499;
        double r279501 = r279496 / r279500;
        double r279502 = r279495 - r279501;
        double r279503 = 3.7574005919343346e+65;
        bool r279504 = r279492 <= r279503;
        double r279505 = r279496 * r279499;
        double r279506 = r279505 / r279492;
        double r279507 = r279495 - r279506;
        double r279508 = r279499 / r279492;
        double r279509 = r279496 * r279508;
        double r279510 = r279495 - r279509;
        double r279511 = r279504 ? r279507 : r279510;
        double r279512 = r279494 ? r279502 : r279511;
        return r279512;
}

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

Original5.9
Target0.7
Herbie1.2
\[\begin{array}{l} \mathbf{if}\;y \lt -1.07612662163899753 \cdot 10^{-10}:\\ \;\;\;\;x - \frac{1}{\frac{\frac{a}{z - t}}{y}}\\ \mathbf{elif}\;y \lt 2.8944268627920891 \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.3995028580527438e+104

    1. Initial program 12.4

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

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

    if -1.3995028580527438e+104 < a < 3.7574005919343346e+65

    1. Initial program 1.6

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

    if 3.7574005919343346e+65 < a

    1. Initial program 10.0

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -1.39950285805274381 \cdot 10^{104}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\ \mathbf{elif}\;a \le 3.75740059193433464 \cdot 10^{65}:\\ \;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{z - t}{a}\\ \end{array}\]

Reproduce

herbie shell --seed 2020045 
(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.0761266216389975e-10) (- x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))

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