Average Error: 24.7 → 12.2
Time: 4.9s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;x \le 1.8634401694288545 \cdot 10^{246}:\\ \;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\ \mathbf{elif}\;x \le 5.34251970619663231 \cdot 10^{284}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - x, \left(\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}\right) \cdot \frac{\sqrt[3]{z - t}}{a - t}, x\right)\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;x \le 1.8634401694288545 \cdot 10^{246}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\

\mathbf{elif}\;x \le 5.34251970619663231 \cdot 10^{284}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r2101175 = x;
        double r2101176 = y;
        double r2101177 = r2101176 - r2101175;
        double r2101178 = z;
        double r2101179 = t;
        double r2101180 = r2101178 - r2101179;
        double r2101181 = r2101177 * r2101180;
        double r2101182 = a;
        double r2101183 = r2101182 - r2101179;
        double r2101184 = r2101181 / r2101183;
        double r2101185 = r2101175 + r2101184;
        return r2101185;
}

double f(double x, double y, double z, double t, double a) {
        double r2101186 = x;
        double r2101187 = 1.8634401694288545e+246;
        bool r2101188 = r2101186 <= r2101187;
        double r2101189 = y;
        double r2101190 = r2101189 - r2101186;
        double r2101191 = z;
        double r2101192 = t;
        double r2101193 = r2101191 - r2101192;
        double r2101194 = a;
        double r2101195 = r2101194 - r2101192;
        double r2101196 = r2101193 / r2101195;
        double r2101197 = fma(r2101190, r2101196, r2101186);
        double r2101198 = 5.342519706196632e+284;
        bool r2101199 = r2101186 <= r2101198;
        double r2101200 = r2101186 / r2101192;
        double r2101201 = r2101191 * r2101189;
        double r2101202 = r2101201 / r2101192;
        double r2101203 = r2101189 - r2101202;
        double r2101204 = fma(r2101200, r2101191, r2101203);
        double r2101205 = cbrt(r2101193);
        double r2101206 = r2101205 * r2101205;
        double r2101207 = r2101205 / r2101195;
        double r2101208 = r2101206 * r2101207;
        double r2101209 = fma(r2101190, r2101208, r2101186);
        double r2101210 = r2101199 ? r2101204 : r2101209;
        double r2101211 = r2101188 ? r2101197 : r2101210;
        return r2101211;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

Original24.7
Target9.0
Herbie12.2
\[\begin{array}{l} \mathbf{if}\;a \lt -1.6153062845442575 \cdot 10^{-142}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \lt 3.7744031700831742 \cdot 10^{-182}:\\ \;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if x < 1.8634401694288545e+246

    1. Initial program 23.8

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

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

      \[\leadsto \color{blue}{\frac{y - x}{a - t} \cdot \left(z - t\right) + x}\]
    5. Using strategy rm
    6. Applied div-inv14.0

      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \cdot \left(z - t\right) + x\]
    7. Applied associate-*l*11.0

      \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(\frac{1}{a - t} \cdot \left(z - t\right)\right)} + x\]
    8. Simplified11.0

      \[\leadsto \left(y - x\right) \cdot \color{blue}{\frac{z - t}{a - t}} + x\]
    9. Using strategy rm
    10. Applied fma-def11.0

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

    if 1.8634401694288545e+246 < x < 5.342519706196632e+284

    1. Initial program 43.6

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

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

      \[\leadsto \color{blue}{\frac{y - x}{a - t} \cdot \left(z - t\right) + x}\]
    5. Using strategy rm
    6. Applied div-inv28.7

      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \cdot \left(z - t\right) + x\]
    7. Applied associate-*l*24.5

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

      \[\leadsto \left(y - x\right) \cdot \color{blue}{\frac{z - t}{a - t}} + x\]
    9. Taylor expanded around inf 48.0

      \[\leadsto \color{blue}{\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}}\]
    10. Simplified44.3

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

    if 5.342519706196632e+284 < x

    1. Initial program 47.3

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

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

      \[\leadsto \color{blue}{\frac{y - x}{a - t} \cdot \left(z - t\right) + x}\]
    5. Using strategy rm
    6. Applied div-inv30.8

      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \cdot \left(z - t\right) + x\]
    7. Applied associate-*l*25.7

      \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(\frac{1}{a - t} \cdot \left(z - t\right)\right)} + x\]
    8. Simplified25.7

      \[\leadsto \left(y - x\right) \cdot \color{blue}{\frac{z - t}{a - t}} + x\]
    9. Using strategy rm
    10. Applied fma-def25.6

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)}\]
    11. Using strategy rm
    12. Applied *-un-lft-identity25.6

      \[\leadsto \mathsf{fma}\left(y - x, \frac{z - t}{\color{blue}{1 \cdot \left(a - t\right)}}, x\right)\]
    13. Applied add-cube-cbrt25.5

      \[\leadsto \mathsf{fma}\left(y - x, \frac{\color{blue}{\left(\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}\right) \cdot \sqrt[3]{z - t}}}{1 \cdot \left(a - t\right)}, x\right)\]
    14. Applied times-frac25.6

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{\frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{1} \cdot \frac{\sqrt[3]{z - t}}{a - t}}, x\right)\]
    15. Simplified25.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le 1.8634401694288545 \cdot 10^{246}:\\ \;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\ \mathbf{elif}\;x \le 5.34251970619663231 \cdot 10^{284}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - x, \left(\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}\right) \cdot \frac{\sqrt[3]{z - t}}{a - t}, x\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020018 +o rules:numerics
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t))))))

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