Average Error: 24.4 → 10.2
Time: 9.5s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -1.057490198627464092017793974169970142422 \cdot 10^{-101} \lor \neg \left(a \le 1.636812059871429043782824409595028094502 \cdot 10^{-123}\right):\\ \;\;\;\;x + \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{t - x}{\sqrt[3]{a - z}}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\frac{x}{z} - \frac{t}{z}\right) + t\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -1.057490198627464092017793974169970142422 \cdot 10^{-101} \lor \neg \left(a \le 1.636812059871429043782824409595028094502 \cdot 10^{-123}\right):\\
\;\;\;\;x + \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{t - x}{\sqrt[3]{a - z}}\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r634331 = x;
        double r634332 = y;
        double r634333 = z;
        double r634334 = r634332 - r634333;
        double r634335 = t;
        double r634336 = r634335 - r634331;
        double r634337 = r634334 * r634336;
        double r634338 = a;
        double r634339 = r634338 - r634333;
        double r634340 = r634337 / r634339;
        double r634341 = r634331 + r634340;
        return r634341;
}

double f(double x, double y, double z, double t, double a) {
        double r634342 = a;
        double r634343 = -1.0574901986274641e-101;
        bool r634344 = r634342 <= r634343;
        double r634345 = 1.636812059871429e-123;
        bool r634346 = r634342 <= r634345;
        double r634347 = !r634346;
        bool r634348 = r634344 || r634347;
        double r634349 = x;
        double r634350 = y;
        double r634351 = z;
        double r634352 = r634350 - r634351;
        double r634353 = cbrt(r634352);
        double r634354 = r634353 * r634353;
        double r634355 = r634342 - r634351;
        double r634356 = cbrt(r634355);
        double r634357 = r634354 / r634356;
        double r634358 = r634353 / r634356;
        double r634359 = t;
        double r634360 = r634359 - r634349;
        double r634361 = r634360 / r634356;
        double r634362 = r634358 * r634361;
        double r634363 = r634357 * r634362;
        double r634364 = r634349 + r634363;
        double r634365 = r634349 / r634351;
        double r634366 = r634359 / r634351;
        double r634367 = r634365 - r634366;
        double r634368 = r634350 * r634367;
        double r634369 = r634368 + r634359;
        double r634370 = r634348 ? r634364 : r634369;
        return r634370;
}

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.4
Target12.2
Herbie10.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 2 regimes
  2. if a < -1.0574901986274641e-101 or 1.636812059871429e-123 < a

    1. Initial program 22.9

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

      \[\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-frac9.2

      \[\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-cbrt9.2

      \[\leadsto x + \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{t - x}{\sqrt[3]{a - z}}\]
    7. Applied times-frac9.2

      \[\leadsto x + \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{t - x}{\sqrt[3]{a - z}}\]
    8. Applied associate-*l*9.1

      \[\leadsto x + \color{blue}{\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{t - x}{\sqrt[3]{a - z}}\right)}\]

    if -1.0574901986274641e-101 < a < 1.636812059871429e-123

    1. Initial program 28.5

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

      \[\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-cbrt21.8

      \[\leadsto x + \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{t - x}{\sqrt[3]{a - z}}\]
    7. Applied times-frac21.8

      \[\leadsto x + \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{t - x}{\sqrt[3]{a - z}}\]
    8. Applied associate-*l*21.2

      \[\leadsto x + \color{blue}{\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{t - x}{\sqrt[3]{a - z}}\right)}\]
    9. Taylor expanded around inf 15.2

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

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

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

Reproduce

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