Average Error: 14.6 → 7.6
Time: 18.8s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -5.94158773471745396 \cdot 10^{-307}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 0.0:\\ \;\;\;\;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 + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -5.94158773471745396 \cdot 10^{-307}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\

\mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 0.0:\\
\;\;\;\;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 r116301 = x;
        double r116302 = y;
        double r116303 = z;
        double r116304 = r116302 - r116303;
        double r116305 = t;
        double r116306 = r116305 - r116301;
        double r116307 = a;
        double r116308 = r116307 - r116303;
        double r116309 = r116306 / r116308;
        double r116310 = r116304 * r116309;
        double r116311 = r116301 + r116310;
        return r116311;
}

double f(double x, double y, double z, double t, double a) {
        double r116312 = x;
        double r116313 = y;
        double r116314 = z;
        double r116315 = r116313 - r116314;
        double r116316 = t;
        double r116317 = r116316 - r116312;
        double r116318 = a;
        double r116319 = r116318 - r116314;
        double r116320 = r116317 / r116319;
        double r116321 = r116315 * r116320;
        double r116322 = r116312 + r116321;
        double r116323 = -5.941587734717454e-307;
        bool r116324 = r116322 <= r116323;
        double r116325 = 0.0;
        bool r116326 = r116322 <= r116325;
        double r116327 = r116312 / r116314;
        double r116328 = r116316 / r116314;
        double r116329 = r116327 - r116328;
        double r116330 = r116313 * r116329;
        double r116331 = r116330 + r116316;
        double r116332 = cbrt(r116319);
        double r116333 = r116332 * r116332;
        double r116334 = r116315 / r116333;
        double r116335 = r116317 / r116332;
        double r116336 = r116334 * r116335;
        double r116337 = r116312 + r116336;
        double r116338 = r116326 ? r116331 : r116337;
        double r116339 = r116324 ? r116322 : r116338;
        return r116339;
}

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

Derivation

  1. Split input into 3 regimes
  2. if (+ x (* (- y z) (/ (- t x) (- a z)))) < -5.941587734717454e-307

    1. Initial program 6.9

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

    if -5.941587734717454e-307 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 0.0

    1. Initial program 61.8

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

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

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

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

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

    1. Initial program 7.7

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

      \[\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-identity8.4

      \[\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-frac8.4

      \[\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}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification7.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -5.94158773471745396 \cdot 10^{-307}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 0.0:\\ \;\;\;\;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 2020047 
(FPCore (x y z t a)
  :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"
  :precision binary64
  (+ x (* (- y z) (/ (- t x) (- a z)))))