Average Error: 14.9 → 10.7
Time: 6.1s
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} \le -1.01785999897600309 \cdot 10^{-306} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 1.16290527 \cdot 10^{-141}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{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 -1.01785999897600309 \cdot 10^{-306} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 1.16290527 \cdot 10^{-141}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{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)))))))) <= -1.0178599989760031e-306) || !(((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z)))))))) <= 1.1629052734548498e-141))) {
		VAR = ((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z))))))));
	} else {
		VAR = ((double) (((double) (((double) (((double) (x * y)) / z)) + t)) - ((double) (((double) (t * y)) / z))));
	}
	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 2 regimes
  2. if (+ x (* (- y z) (/ (- t x) (- a z)))) < -1.01785999897600309e-306 or 1.16290527e-141 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 6.6

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

    if -1.01785999897600309e-306 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 1.16290527e-141

    1. Initial program 51.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -1.01785999897600309 \cdot 10^{-306} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 1.16290527 \cdot 10^{-141}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]

Reproduce

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