Average Error: 15.1 → 10.4
Time: 10.3s
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.669233844605291 \cdot 10^{-167} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 5.60029024467808247 \cdot 10^{-209}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \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.669233844605291 \cdot 10^{-167} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 5.60029024467808247 \cdot 10^{-209}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (y - z)) * (((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) (t - x)) / ((double) (a - z))))))) <= -1.669233844605291e-167) || !(((double) (x + ((double) (((double) (y - z)) * (((double) (t - x)) / ((double) (a - z))))))) <= 5.600290244678082e-209))) {
		VAR = ((double) (x + ((double) (((double) (y - z)) * (((double) (t - x)) / ((double) (a - z)))))));
	} else {
		VAR = ((double) (t + ((double) (y * ((double) ((x / z) - (t / 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.669233844605291e-167 or 5.60029024467808247e-209 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 6.2

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

    if -1.669233844605291e-167 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 5.60029024467808247e-209

    1. Initial program 51.2

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

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

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

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

Reproduce

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