Average Error: 25.2 → 8.9
Time: 12.7s
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 -6.35262688856634336 \cdot 10^{-298} \lor \neg \left(x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 9.92755 \cdot 10^{-256}\right):\\ \;\;\;\;x + \left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}\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 -6.35262688856634336 \cdot 10^{-298} \lor \neg \left(x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 9.92755 \cdot 10^{-256}\right):\\
\;\;\;\;x + \left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}\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 r3716 = x;
        double r3717 = y;
        double r3718 = z;
        double r3719 = r3717 - r3718;
        double r3720 = t;
        double r3721 = r3720 - r3716;
        double r3722 = r3719 * r3721;
        double r3723 = a;
        double r3724 = r3723 - r3718;
        double r3725 = r3722 / r3724;
        double r3726 = r3716 + r3725;
        return r3726;
}

double f(double x, double y, double z, double t, double a) {
        double r3727 = x;
        double r3728 = y;
        double r3729 = z;
        double r3730 = r3728 - r3729;
        double r3731 = t;
        double r3732 = r3731 - r3727;
        double r3733 = r3730 * r3732;
        double r3734 = a;
        double r3735 = r3734 - r3729;
        double r3736 = r3733 / r3735;
        double r3737 = r3727 + r3736;
        double r3738 = -6.352626888566343e-298;
        bool r3739 = r3737 <= r3738;
        double r3740 = 9.92755017398561e-256;
        bool r3741 = r3737 <= r3740;
        double r3742 = !r3741;
        bool r3743 = r3739 || r3742;
        double r3744 = cbrt(r3732);
        double r3745 = r3744 * r3744;
        double r3746 = cbrt(r3735);
        double r3747 = r3746 * r3746;
        double r3748 = r3745 / r3747;
        double r3749 = r3730 * r3748;
        double r3750 = r3744 / r3746;
        double r3751 = r3749 * r3750;
        double r3752 = r3727 + r3751;
        double r3753 = r3727 * r3728;
        double r3754 = r3753 / r3729;
        double r3755 = r3754 + r3731;
        double r3756 = r3731 * r3728;
        double r3757 = r3756 / r3729;
        double r3758 = r3755 - r3757;
        double r3759 = r3743 ? r3752 : r3758;
        return r3759;
}

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

Original25.2
Target12.0
Herbie8.9
\[\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 (+ x (/ (* (- y z) (- t x)) (- a z))) < -6.352626888566343e-298 or 9.92755017398561e-256 < (+ x (/ (* (- y z) (- t x)) (- a z)))

    1. Initial program 22.0

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

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

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

      \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt11.1

      \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}}\]
    8. Applied add-cube-cbrt11.2

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

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

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

    if -6.352626888566343e-298 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 9.92755017398561e-256

    1. Initial program 56.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -6.35262688856634336 \cdot 10^{-298} \lor \neg \left(x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 9.92755 \cdot 10^{-256}\right):\\ \;\;\;\;x + \left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}\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 2020025 
(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))))