Average Error: 15.4 → 7.7
Time: 6.4s
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} = -inf.0:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -2.281423918374785 \cdot 10^{47}:\\ \;\;\;\;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 -8.41081356300309327 \cdot 10^{-307}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 5.3573301852343988 \cdot 10^{-306}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{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} = -inf.0:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\

\mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -2.281423918374785 \cdot 10^{47}:\\
\;\;\;\;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 -8.41081356300309327 \cdot 10^{-307}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\

\mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 5.3573301852343988 \cdot 10^{-306}:\\
\;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z))))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z)))))))) <= -inf.0)) {
		VAR = ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))));
	} else {
		double VAR_1;
		if ((((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z)))))))) <= -2.281423918374785e+47)) {
			VAR_1 = ((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z))))))));
		} else {
			double VAR_2;
			if ((((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z)))))))) <= -8.410813563003093e-307)) {
				VAR_2 = ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))));
			} else {
				double VAR_3;
				if ((((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z)))))))) <= 5.357330185234399e-306)) {
					VAR_3 = ((double) (t + ((double) (y * ((double) (((double) (x / z)) - ((double) (t / z))))))));
				} else {
					VAR_3 = ((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z))))))));
				}
				VAR_2 = VAR_3;
			}
			VAR_1 = VAR_2;
		}
		VAR = VAR_1;
	}
	return VAR;
}

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)))) < -inf.0 or -2.281423918374785e+47 < (+ x (* (- y z) (/ (- t x) (- a z)))) < -8.410813563003093e-307

    1. Initial program 16.7

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Using strategy rm
    3. Applied associate-*r/6.7

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

    if -inf.0 < (+ x (* (- y z) (/ (- t x) (- a z)))) < -2.281423918374785e+47 or 5.357330185234399e-306 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 5.6

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

    if -8.410813563003093e-307 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 5.357330185234399e-306

    1. Initial program 61.6

      \[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. Applied associate-*r*61.4

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} = -inf.0:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -2.281423918374785 \cdot 10^{47}:\\ \;\;\;\;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 -8.41081356300309327 \cdot 10^{-307}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 5.3573301852343988 \cdot 10^{-306}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \end{array}\]

Reproduce

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