Average Error: 10.4 → 0.8
Time: 18.0s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;t \le -6.012545261316454786172528157872615913891 \cdot 10^{-96} \lor \neg \left(t \le 2.588908446285731015618837526142587793708 \cdot 10^{-201}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{a - z} - \frac{z}{a - z}, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left(\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}\right) \cdot \left(\sqrt[3]{y - z} \cdot t\right)}{a - z}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;t \le -6.012545261316454786172528157872615913891 \cdot 10^{-96} \lor \neg \left(t \le 2.588908446285731015618837526142587793708 \cdot 10^{-201}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - z} - \frac{z}{a - z}, t, x\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r348675 = x;
        double r348676 = y;
        double r348677 = z;
        double r348678 = r348676 - r348677;
        double r348679 = t;
        double r348680 = r348678 * r348679;
        double r348681 = a;
        double r348682 = r348681 - r348677;
        double r348683 = r348680 / r348682;
        double r348684 = r348675 + r348683;
        return r348684;
}

double f(double x, double y, double z, double t, double a) {
        double r348685 = t;
        double r348686 = -6.012545261316455e-96;
        bool r348687 = r348685 <= r348686;
        double r348688 = 2.588908446285731e-201;
        bool r348689 = r348685 <= r348688;
        double r348690 = !r348689;
        bool r348691 = r348687 || r348690;
        double r348692 = y;
        double r348693 = a;
        double r348694 = z;
        double r348695 = r348693 - r348694;
        double r348696 = r348692 / r348695;
        double r348697 = r348694 / r348695;
        double r348698 = r348696 - r348697;
        double r348699 = x;
        double r348700 = fma(r348698, r348685, r348699);
        double r348701 = r348692 - r348694;
        double r348702 = cbrt(r348701);
        double r348703 = r348702 * r348702;
        double r348704 = r348702 * r348685;
        double r348705 = r348703 * r348704;
        double r348706 = r348705 / r348695;
        double r348707 = r348699 + r348706;
        double r348708 = r348691 ? r348700 : r348707;
        return r348708;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

Original10.4
Target0.6
Herbie0.8
\[\begin{array}{l} \mathbf{if}\;t \lt -1.068297449017406694366747246993994850729 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.911094988758637497591020599238553861375 \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 < -6.012545261316455e-96 or 2.588908446285731e-201 < t

    1. Initial program 14.3

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)}\]
    3. Using strategy rm
    4. Applied div-sub0.9

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{a - z} - \frac{z}{a - z}}, t, x\right)\]

    if -6.012545261316455e-96 < t < 2.588908446285731e-201

    1. Initial program 0.4

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

      \[\leadsto x + \frac{\color{blue}{\left(\left(\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}\right) \cdot \sqrt[3]{y - z}\right)} \cdot t}{a - z}\]
    4. Applied associate-*l*0.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -6.012545261316454786172528157872615913891 \cdot 10^{-96} \lor \neg \left(t \le 2.588908446285731015618837526142587793708 \cdot 10^{-201}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{a - z} - \frac{z}{a - z}, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left(\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}\right) \cdot \left(\sqrt[3]{y - z} \cdot t\right)}{a - z}\\ \end{array}\]

Reproduce

herbie shell --seed 2019325 +o rules:numerics
(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))))