Average Error: 9.8 → 0.8
Time: 11.0s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;t \le -3.7837824042503885 \cdot 10^{+55}:\\ \;\;\;\;\frac{y - z}{a - z} \cdot t + x\\ \mathbf{elif}\;t \le 3.399610075108991 \cdot 10^{-192}:\\ \;\;\;\;x + \left(t \cdot \left(y - z\right)\right) \cdot \frac{1}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z}{a - z} \cdot t + x\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;t \le -3.7837824042503885 \cdot 10^{+55}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t + x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r12007652 = x;
        double r12007653 = y;
        double r12007654 = z;
        double r12007655 = r12007653 - r12007654;
        double r12007656 = t;
        double r12007657 = r12007655 * r12007656;
        double r12007658 = a;
        double r12007659 = r12007658 - r12007654;
        double r12007660 = r12007657 / r12007659;
        double r12007661 = r12007652 + r12007660;
        return r12007661;
}

double f(double x, double y, double z, double t, double a) {
        double r12007662 = t;
        double r12007663 = -3.7837824042503885e+55;
        bool r12007664 = r12007662 <= r12007663;
        double r12007665 = y;
        double r12007666 = z;
        double r12007667 = r12007665 - r12007666;
        double r12007668 = a;
        double r12007669 = r12007668 - r12007666;
        double r12007670 = r12007667 / r12007669;
        double r12007671 = r12007670 * r12007662;
        double r12007672 = x;
        double r12007673 = r12007671 + r12007672;
        double r12007674 = 3.399610075108991e-192;
        bool r12007675 = r12007662 <= r12007674;
        double r12007676 = r12007662 * r12007667;
        double r12007677 = 1.0;
        double r12007678 = r12007677 / r12007669;
        double r12007679 = r12007676 * r12007678;
        double r12007680 = r12007672 + r12007679;
        double r12007681 = r12007675 ? r12007680 : r12007673;
        double r12007682 = r12007664 ? r12007673 : r12007681;
        return r12007682;
}

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

Original9.8
Target0.4
Herbie0.8
\[\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 < -3.7837824042503885e+55 or 3.399610075108991e-192 < t

    1. Initial program 16.6

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

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

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

    if -3.7837824042503885e+55 < t < 3.399610075108991e-192

    1. Initial program 0.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -3.7837824042503885 \cdot 10^{+55}:\\ \;\;\;\;\frac{y - z}{a - z} \cdot t + x\\ \mathbf{elif}\;t \le 3.399610075108991 \cdot 10^{-192}:\\ \;\;\;\;x + \left(t \cdot \left(y - z\right)\right) \cdot \frac{1}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z}{a - z} \cdot t + x\\ \end{array}\]

Reproduce

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

  :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))))