Average Error: 24.5 → 8.5
Time: 19.8s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -2.32490640665928128674486260054726540816 \cdot 10^{-294} \lor \neg \left(x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 0.0\right):\\ \;\;\;\;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]{1}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -2.32490640665928128674486260054726540816 \cdot 10^{-294} \lor \neg \left(x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 0.0\right):\\
\;\;\;\;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]{1}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r435361 = x;
        double r435362 = y;
        double r435363 = z;
        double r435364 = r435362 - r435363;
        double r435365 = t;
        double r435366 = r435365 - r435361;
        double r435367 = r435364 * r435366;
        double r435368 = a;
        double r435369 = r435368 - r435363;
        double r435370 = r435367 / r435369;
        double r435371 = r435361 + r435370;
        return r435371;
}

double f(double x, double y, double z, double t, double a) {
        double r435372 = x;
        double r435373 = y;
        double r435374 = z;
        double r435375 = r435373 - r435374;
        double r435376 = t;
        double r435377 = r435376 - r435372;
        double r435378 = r435375 * r435377;
        double r435379 = a;
        double r435380 = r435379 - r435374;
        double r435381 = r435378 / r435380;
        double r435382 = r435372 + r435381;
        double r435383 = -2.3249064066592813e-294;
        bool r435384 = r435382 <= r435383;
        double r435385 = 0.0;
        bool r435386 = r435382 <= r435385;
        double r435387 = !r435386;
        bool r435388 = r435384 || r435387;
        double r435389 = cbrt(r435380);
        double r435390 = r435389 * r435389;
        double r435391 = r435375 / r435390;
        double r435392 = cbrt(r435377);
        double r435393 = r435392 * r435392;
        double r435394 = 1.0;
        double r435395 = cbrt(r435394);
        double r435396 = r435393 / r435395;
        double r435397 = r435391 * r435396;
        double r435398 = r435392 / r435389;
        double r435399 = r435397 * r435398;
        double r435400 = r435372 + r435399;
        double r435401 = r435372 * r435373;
        double r435402 = r435401 / r435374;
        double r435403 = r435402 + r435376;
        double r435404 = r435376 * r435373;
        double r435405 = r435404 / r435374;
        double r435406 = r435403 - r435405;
        double r435407 = r435388 ? r435400 : r435406;
        return r435407;
}

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
Target11.8
Herbie8.5
\[\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 2 regimes
  2. if (+ x (/ (* (- y z) (- t x)) (- a z))) < -2.3249064066592813e-294 or 0.0 < (+ x (/ (* (- y z) (- t x)) (- a z)))

    1. Initial program 21.3

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt21.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-frac8.3

      \[\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 *-un-lft-identity8.3

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

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

      \[\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]{1} \cdot \sqrt[3]{a - z}}\]
    9. Applied times-frac8.4

      \[\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]{1}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)}\]
    10. Applied associate-*r*7.8

      \[\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]{1}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}}\]

    if -2.3249064066592813e-294 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 0.0

    1. Initial program 60.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -2.32490640665928128674486260054726540816 \cdot 10^{-294} \lor \neg \left(x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 0.0\right):\\ \;\;\;\;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]{1}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2019291 
(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))))