Average Error: 14.3 → 8.3
Time: 11.2s
Precision: binary64
\[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 -4.4406093630156213 \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:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 6.8826547580861096 \cdot 10^{-7}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \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 -4.4406093630156213 \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:\\
\;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\

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

\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)))))))) <= -4.440609363015621e-307)) {
			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)))))))) <= 0.0)) {
				VAR_2 = ((double) (((double) (((double) (((double) (x * y)) / z)) + t)) - ((double) (((double) (t * y)) / z))));
			} else {
				double VAR_3;
				if ((((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z)))))))) <= 6.88265475808611e-07)) {
					VAR_3 = ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - 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 0.0 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 6.88265475808611e-07

    1. Initial program 18.8

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

      \[\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)))) < -4.440609363015621e-307 or 6.88265475808611e-07 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 5.4

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

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

    1. Initial program 61.7

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

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

    \[\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 -4.4406093630156213 \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:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 6.8826547580861096 \cdot 10^{-7}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \end{array}\]

Reproduce

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