Average Error: 23.5 → 10.2
Time: 15.7s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.475023629453871 \cdot 10^{+224}:\\ \;\;\;\;t + \left(\frac{x}{z} - \frac{t}{z}\right) \cdot y\\ \mathbf{elif}\;z \le -3.7334196290920285 \cdot 10^{+161}:\\ \;\;\;\;x + \frac{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right)}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{a - z}}}\\ \mathbf{elif}\;z \le -1.8753923642354137 \cdot 10^{+127}:\\ \;\;\;\;\left(t + \frac{y \cdot x}{z}\right) - \frac{y \cdot t}{z}\\ \mathbf{elif}\;z \le -4.5379833508644655 \cdot 10^{-66}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t - x}{a - z} + x\\ \mathbf{elif}\;z \le 9.487844680062526 \cdot 10^{+198}:\\ \;\;\;\;x + \frac{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right)}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{a - z}}}\\ \mathbf{else}:\\ \;\;\;\;t + \left(\frac{x}{z} - \frac{t}{z}\right) \cdot y\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;z \le -5.475023629453871 \cdot 10^{+224}:\\
\;\;\;\;t + \left(\frac{x}{z} - \frac{t}{z}\right) \cdot y\\

\mathbf{elif}\;z \le -3.7334196290920285 \cdot 10^{+161}:\\
\;\;\;\;x + \frac{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right)}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{a - z}}}\\

\mathbf{elif}\;z \le -1.8753923642354137 \cdot 10^{+127}:\\
\;\;\;\;\left(t + \frac{y \cdot x}{z}\right) - \frac{y \cdot t}{z}\\

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

\mathbf{elif}\;z \le 9.487844680062526 \cdot 10^{+198}:\\
\;\;\;\;x + \frac{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right)}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{a - z}}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r11549560 = x;
        double r11549561 = y;
        double r11549562 = z;
        double r11549563 = r11549561 - r11549562;
        double r11549564 = t;
        double r11549565 = r11549564 - r11549560;
        double r11549566 = r11549563 * r11549565;
        double r11549567 = a;
        double r11549568 = r11549567 - r11549562;
        double r11549569 = r11549566 / r11549568;
        double r11549570 = r11549560 + r11549569;
        return r11549570;
}

double f(double x, double y, double z, double t, double a) {
        double r11549571 = z;
        double r11549572 = -5.475023629453871e+224;
        bool r11549573 = r11549571 <= r11549572;
        double r11549574 = t;
        double r11549575 = x;
        double r11549576 = r11549575 / r11549571;
        double r11549577 = r11549574 / r11549571;
        double r11549578 = r11549576 - r11549577;
        double r11549579 = y;
        double r11549580 = r11549578 * r11549579;
        double r11549581 = r11549574 + r11549580;
        double r11549582 = -3.7334196290920285e+161;
        bool r11549583 = r11549571 <= r11549582;
        double r11549584 = r11549579 - r11549571;
        double r11549585 = a;
        double r11549586 = r11549585 - r11549571;
        double r11549587 = cbrt(r11549586);
        double r11549588 = r11549587 * r11549587;
        double r11549589 = r11549584 / r11549588;
        double r11549590 = r11549574 - r11549575;
        double r11549591 = cbrt(r11549590);
        double r11549592 = r11549591 * r11549591;
        double r11549593 = r11549589 * r11549592;
        double r11549594 = cbrt(r11549588);
        double r11549595 = r11549593 / r11549594;
        double r11549596 = cbrt(r11549587);
        double r11549597 = r11549591 / r11549596;
        double r11549598 = r11549595 * r11549597;
        double r11549599 = r11549575 + r11549598;
        double r11549600 = -1.8753923642354137e+127;
        bool r11549601 = r11549571 <= r11549600;
        double r11549602 = r11549579 * r11549575;
        double r11549603 = r11549602 / r11549571;
        double r11549604 = r11549574 + r11549603;
        double r11549605 = r11549579 * r11549574;
        double r11549606 = r11549605 / r11549571;
        double r11549607 = r11549604 - r11549606;
        double r11549608 = -4.5379833508644655e-66;
        bool r11549609 = r11549571 <= r11549608;
        double r11549610 = r11549590 / r11549586;
        double r11549611 = r11549584 * r11549610;
        double r11549612 = r11549611 + r11549575;
        double r11549613 = 9.487844680062526e+198;
        bool r11549614 = r11549571 <= r11549613;
        double r11549615 = r11549614 ? r11549599 : r11549581;
        double r11549616 = r11549609 ? r11549612 : r11549615;
        double r11549617 = r11549601 ? r11549607 : r11549616;
        double r11549618 = r11549583 ? r11549599 : r11549617;
        double r11549619 = r11549573 ? r11549581 : r11549618;
        return r11549619;
}

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

Original23.5
Target11.5
Herbie10.2
\[\begin{array}{l} \mathbf{if}\;z \lt -1.2536131056095036 \cdot 10^{+188}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{elif}\;z \lt 4.446702369113811 \cdot 10^{+64}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \end{array}\]

Derivation

  1. Split input into 4 regimes
  2. if z < -5.475023629453871e+224 or 9.487844680062526e+198 < z

    1. Initial program 49.5

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt28.7

      \[\leadsto x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{\color{blue}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}}}\]
    7. Applied cbrt-prod28.8

      \[\leadsto x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\color{blue}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \sqrt[3]{\sqrt[3]{a - z}}}}\]
    8. Applied add-cube-cbrt29.0

      \[\leadsto x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{\color{blue}{\left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right) \cdot \sqrt[3]{t - x}}}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \sqrt[3]{\sqrt[3]{a - z}}}\]
    9. Applied times-frac29.0

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

      \[\leadsto x + \color{blue}{\left(\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{a - z}}}}\]
    11. Using strategy rm
    12. Applied add-cube-cbrt27.9

      \[\leadsto x + \left(\frac{\color{blue}{\left(\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}\right) \cdot \sqrt[3]{y - z}}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{a - z}}}\]
    13. Applied times-frac27.9

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

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

      \[\leadsto \color{blue}{\left(t + \frac{x \cdot y}{z}\right) - \frac{t \cdot y}{z}}\]
    16. Simplified13.8

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

    if -5.475023629453871e+224 < z < -3.7334196290920285e+161 or -4.5379833508644655e-66 < z < 9.487844680062526e+198

    1. Initial program 17.1

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

      \[\leadsto x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{\color{blue}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}}\]
    4. Applied times-frac8.8

      \[\leadsto x + \color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt8.9

      \[\leadsto x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{\color{blue}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}}}\]
    7. Applied cbrt-prod8.9

      \[\leadsto x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\color{blue}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \sqrt[3]{\sqrt[3]{a - z}}}}\]
    8. Applied add-cube-cbrt9.1

      \[\leadsto x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{\color{blue}{\left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right) \cdot \sqrt[3]{t - x}}}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \sqrt[3]{\sqrt[3]{a - z}}}\]
    9. Applied times-frac9.1

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

      \[\leadsto x + \color{blue}{\left(\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{a - z}}}}\]
    11. Using strategy rm
    12. Applied associate-*r/8.4

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

    if -3.7334196290920285e+161 < z < -1.8753923642354137e+127

    1. Initial program 37.6

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Taylor expanded around inf 27.4

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

    if -1.8753923642354137e+127 < z < -4.5379833508644655e-66

    1. Initial program 17.6

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{1} \cdot \frac{t - x}{a - z}}\]
    5. Simplified10.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.475023629453871 \cdot 10^{+224}:\\ \;\;\;\;t + \left(\frac{x}{z} - \frac{t}{z}\right) \cdot y\\ \mathbf{elif}\;z \le -3.7334196290920285 \cdot 10^{+161}:\\ \;\;\;\;x + \frac{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right)}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{a - z}}}\\ \mathbf{elif}\;z \le -1.8753923642354137 \cdot 10^{+127}:\\ \;\;\;\;\left(t + \frac{y \cdot x}{z}\right) - \frac{y \cdot t}{z}\\ \mathbf{elif}\;z \le -4.5379833508644655 \cdot 10^{-66}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t - x}{a - z} + x\\ \mathbf{elif}\;z \le 9.487844680062526 \cdot 10^{+198}:\\ \;\;\;\;x + \frac{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right)}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{a - z}}}\\ \mathbf{else}:\\ \;\;\;\;t + \left(\frac{x}{z} - \frac{t}{z}\right) \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019156 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"

  :herbie-target
  (if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))

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