Average Error: 10.6 → 0.5
Time: 5.0s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;t \le -8.19068631765703301 \cdot 10^{-50} \lor \neg \left(t \le 4.31934043906759666 \cdot 10^{-85}\right):\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{a - z}{\left(y - z\right) \cdot t}}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;t \le -8.19068631765703301 \cdot 10^{-50} \lor \neg \left(t \le 4.31934043906759666 \cdot 10^{-85}\right):\\
\;\;\;\;x + \frac{y - z}{a - z} \cdot t\\

\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{a - z}{\left(y - z\right) \cdot t}}\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r581521 = x;
        double r581522 = y;
        double r581523 = z;
        double r581524 = r581522 - r581523;
        double r581525 = t;
        double r581526 = r581524 * r581525;
        double r581527 = a;
        double r581528 = r581527 - r581523;
        double r581529 = r581526 / r581528;
        double r581530 = r581521 + r581529;
        return r581530;
}

double f(double x, double y, double z, double t, double a) {
        double r581531 = t;
        double r581532 = -8.190686317657033e-50;
        bool r581533 = r581531 <= r581532;
        double r581534 = 4.3193404390675967e-85;
        bool r581535 = r581531 <= r581534;
        double r581536 = !r581535;
        bool r581537 = r581533 || r581536;
        double r581538 = x;
        double r581539 = y;
        double r581540 = z;
        double r581541 = r581539 - r581540;
        double r581542 = a;
        double r581543 = r581542 - r581540;
        double r581544 = r581541 / r581543;
        double r581545 = r581544 * r581531;
        double r581546 = r581538 + r581545;
        double r581547 = 1.0;
        double r581548 = r581541 * r581531;
        double r581549 = r581543 / r581548;
        double r581550 = r581547 / r581549;
        double r581551 = r581538 + r581550;
        double r581552 = r581537 ? r581546 : r581551;
        return r581552;
}

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

Original10.6
Target0.6
Herbie0.5
\[\begin{array}{l} \mathbf{if}\;t \lt -1.0682974490174067 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.9110949887586375 \cdot 10^{-141}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if t < -8.190686317657033e-50 or 4.3193404390675967e-85 < t

    1. Initial program 18.0

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

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

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

    if -8.190686317657033e-50 < t < 4.3193404390675967e-85

    1. Initial program 0.5

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

      \[\leadsto x + \color{blue}{\frac{1}{\frac{a - z}{\left(y - z\right) \cdot t}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -8.19068631765703301 \cdot 10^{-50} \lor \neg \left(t \le 4.31934043906759666 \cdot 10^{-85}\right):\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{a - z}{\left(y - z\right) \cdot t}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020064 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
  :precision binary64

  :herbie-target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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