Average Error: 14.1 → 7.5
Time: 23.2s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le -1.610319660026901692627567289598819324756 \cdot 10^{-296}:\\ \;\;\;\;x + \frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}}} \cdot \sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}\\ \mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 8.534091484152259531516940965253705574405 \cdot 10^{-283}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}}} \cdot \sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le -1.610319660026901692627567289598819324756 \cdot 10^{-296}:\\
\;\;\;\;x + \frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}}} \cdot \sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}\\

\mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 8.534091484152259531516940965253705574405 \cdot 10^{-283}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r3857585 = x;
        double r3857586 = y;
        double r3857587 = z;
        double r3857588 = r3857586 - r3857587;
        double r3857589 = t;
        double r3857590 = r3857589 - r3857585;
        double r3857591 = a;
        double r3857592 = r3857591 - r3857587;
        double r3857593 = r3857590 / r3857592;
        double r3857594 = r3857588 * r3857593;
        double r3857595 = r3857585 + r3857594;
        return r3857595;
}

double f(double x, double y, double z, double t, double a) {
        double r3857596 = x;
        double r3857597 = t;
        double r3857598 = r3857597 - r3857596;
        double r3857599 = a;
        double r3857600 = z;
        double r3857601 = r3857599 - r3857600;
        double r3857602 = r3857598 / r3857601;
        double r3857603 = y;
        double r3857604 = r3857603 - r3857600;
        double r3857605 = r3857602 * r3857604;
        double r3857606 = r3857596 + r3857605;
        double r3857607 = -1.6103196600269017e-296;
        bool r3857608 = r3857606 <= r3857607;
        double r3857609 = cbrt(r3857601);
        double r3857610 = r3857598 / r3857609;
        double r3857611 = cbrt(r3857610);
        double r3857612 = r3857609 / r3857611;
        double r3857613 = r3857612 * r3857612;
        double r3857614 = r3857604 / r3857613;
        double r3857615 = r3857614 * r3857611;
        double r3857616 = r3857596 + r3857615;
        double r3857617 = 8.53409148415226e-283;
        bool r3857618 = r3857606 <= r3857617;
        double r3857619 = r3857596 / r3857600;
        double r3857620 = r3857597 / r3857600;
        double r3857621 = r3857619 - r3857620;
        double r3857622 = fma(r3857603, r3857621, r3857597);
        double r3857623 = r3857618 ? r3857622 : r3857616;
        double r3857624 = r3857608 ? r3857616 : r3857623;
        return r3857624;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Derivation

  1. Split input into 2 regimes
  2. if (+ x (* (- y z) (/ (- t x) (- a z)))) < -1.6103196600269017e-296 or 8.53409148415226e-283 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 7.1

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

      \[\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}}}\]
    4. Applied *-un-lft-identity7.8

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt5.2

      \[\leadsto x + \frac{y - z}{\sqrt[3]{a - z} \cdot \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)}\]
    10. Applied associate-*r*5.2

      \[\leadsto x + \color{blue}{\left(\frac{y - z}{\sqrt[3]{a - z} \cdot \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}}}}\]
    11. Simplified5.7

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

    if -1.6103196600269017e-296 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 8.53409148415226e-283

    1. Initial program 60.5

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Simplified60.1

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)}\]
    3. Taylor expanded around inf 25.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le -1.610319660026901692627567289598819324756 \cdot 10^{-296}:\\ \;\;\;\;x + \frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}}} \cdot \sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}\\ \mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 8.534091484152259531516940965253705574405 \cdot 10^{-283}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}}} \cdot \sqrt[3]{\frac{t - x}{\sqrt[3]{a - z}}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019169 +o rules:numerics
(FPCore (x y z t a)
  :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"
  (+ x (* (- y z) (/ (- t x) (- a z)))))