Average Error: 24.5 → 11.2
Time: 15.3s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -1.050612754589822275184879291127116839019 \cdot 10^{-181}:\\ \;\;\;\;x + \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}}}\\ \mathbf{elif}\;a \le 3.22787961121169314702562156874412508262 \cdot 10^{-168}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \sqrt[3]{\sqrt[3]{a - z}}}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -1.050612754589822275184879291127116839019 \cdot 10^{-181}:\\
\;\;\;\;x + \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}}}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r393386 = x;
        double r393387 = y;
        double r393388 = z;
        double r393389 = r393387 - r393388;
        double r393390 = t;
        double r393391 = r393390 - r393386;
        double r393392 = r393389 * r393391;
        double r393393 = a;
        double r393394 = r393393 - r393388;
        double r393395 = r393392 / r393394;
        double r393396 = r393386 + r393395;
        return r393396;
}

double f(double x, double y, double z, double t, double a) {
        double r393397 = a;
        double r393398 = -1.0506127545898223e-181;
        bool r393399 = r393397 <= r393398;
        double r393400 = x;
        double r393401 = y;
        double r393402 = z;
        double r393403 = r393401 - r393402;
        double r393404 = r393397 - r393402;
        double r393405 = cbrt(r393404);
        double r393406 = r393405 * r393405;
        double r393407 = r393403 / r393406;
        double r393408 = t;
        double r393409 = r393408 - r393400;
        double r393410 = cbrt(r393409);
        double r393411 = r393410 * r393410;
        double r393412 = cbrt(r393406);
        double r393413 = r393411 / r393412;
        double r393414 = r393407 * r393413;
        double r393415 = cbrt(r393405);
        double r393416 = r393410 / r393415;
        double r393417 = r393414 * r393416;
        double r393418 = r393400 + r393417;
        double r393419 = 3.227879611211693e-168;
        bool r393420 = r393397 <= r393419;
        double r393421 = r393400 * r393401;
        double r393422 = r393421 / r393402;
        double r393423 = r393422 + r393408;
        double r393424 = r393408 * r393401;
        double r393425 = r393424 / r393402;
        double r393426 = r393423 - r393425;
        double r393427 = r393412 * r393415;
        double r393428 = r393409 / r393427;
        double r393429 = r393407 * r393428;
        double r393430 = r393400 + r393429;
        double r393431 = r393420 ? r393426 : r393430;
        double r393432 = r393399 ? r393418 : r393431;
        return r393432;
}

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

Original24.5
Target12.5
Herbie11.2
\[\begin{array}{l} \mathbf{if}\;z \lt -1.253613105609503593846459977496550767343 \cdot 10^{188}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{elif}\;z \lt 4.446702369113811028051510715777703865332 \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 3 regimes
  2. if a < -1.0506127545898223e-181

    1. Initial program 23.7

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

      \[\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-frac11.4

      \[\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-cbrt11.4

      \[\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-prod11.4

      \[\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-cbrt11.6

      \[\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-frac11.5

      \[\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*11.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}}}}\]

    if -1.0506127545898223e-181 < a < 3.227879611211693e-168

    1. Initial program 29.2

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

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

    if 3.227879611211693e-168 < a

    1. Initial program 23.2

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

      \[\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-frac11.5

      \[\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-cbrt11.6

      \[\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-prod11.6

      \[\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}}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification11.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -1.050612754589822275184879291127116839019 \cdot 10^{-181}:\\ \;\;\;\;x + \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}}}\\ \mathbf{elif}\;a \le 3.22787961121169314702562156874412508262 \cdot 10^{-168}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \sqrt[3]{\sqrt[3]{a - z}}}\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< z -1.25361310560950359e188) (- t (* (/ y z) (- t x))) (if (< z 4.44670236911381103e64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))

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