Average Error: 24.5 → 10.3
Time: 17.1s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.229039851220961 \cdot 10^{234} \lor \neg \left(z \le 1.15096756339151705 \cdot 10^{227}\right):\\ \;\;\;\;y \cdot \left(\frac{x}{z} - \frac{t}{z}\right) + t\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;z \le -5.229039851220961 \cdot 10^{234} \lor \neg \left(z \le 1.15096756339151705 \cdot 10^{227}\right):\\
\;\;\;\;y \cdot \left(\frac{x}{z} - \frac{t}{z}\right) + t\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r806573 = x;
        double r806574 = y;
        double r806575 = z;
        double r806576 = r806574 - r806575;
        double r806577 = t;
        double r806578 = r806577 - r806573;
        double r806579 = r806576 * r806578;
        double r806580 = a;
        double r806581 = r806580 - r806575;
        double r806582 = r806579 / r806581;
        double r806583 = r806573 + r806582;
        return r806583;
}

double f(double x, double y, double z, double t, double a) {
        double r806584 = z;
        double r806585 = -5.229039851220961e+234;
        bool r806586 = r806584 <= r806585;
        double r806587 = 1.150967563391517e+227;
        bool r806588 = r806584 <= r806587;
        double r806589 = !r806588;
        bool r806590 = r806586 || r806589;
        double r806591 = y;
        double r806592 = x;
        double r806593 = r806592 / r806584;
        double r806594 = t;
        double r806595 = r806594 / r806584;
        double r806596 = r806593 - r806595;
        double r806597 = r806591 * r806596;
        double r806598 = r806597 + r806594;
        double r806599 = r806591 - r806584;
        double r806600 = a;
        double r806601 = r806600 - r806584;
        double r806602 = cbrt(r806601);
        double r806603 = r806602 * r806602;
        double r806604 = r806599 / r806603;
        double r806605 = r806594 - r806592;
        double r806606 = r806605 / r806602;
        double r806607 = r806604 * r806606;
        double r806608 = r806592 + r806607;
        double r806609 = r806590 ? r806598 : r806608;
        return r806609;
}

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.0
Herbie10.3
\[\begin{array}{l} \mathbf{if}\;z \lt -1.25361310560950359 \cdot 10^{188}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{elif}\;z \lt 4.44670236911381103 \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 z < -5.229039851220961e+234 or 1.150967563391517e+227 < z

    1. Initial program 52.2

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

      \[\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-frac27.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-cbrt27.7

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

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

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

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

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

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

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

    if -5.229039851220961e+234 < z < 1.150967563391517e+227

    1. Initial program 19.8

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

      \[\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.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.229039851220961 \cdot 10^{234} \lor \neg \left(z \le 1.15096756339151705 \cdot 10^{227}\right):\\ \;\;\;\;y \cdot \left(\frac{x}{z} - \frac{t}{z}\right) + t\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\ \end{array}\]

Reproduce

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