Average Error: 14.8 → 11.4
Time: 5.3s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -6.3409255795068648 \cdot 10^{216}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \mathbf{elif}\;z \le 8.482328112026546 \cdot 10^{-274}:\\ \;\;\;\;\frac{y}{\frac{a - z}{t - x}} - \left(\frac{z}{\frac{a - z}{t - x}} - x\right)\\ \mathbf{elif}\;z \le 1.0048489443141935 \cdot 10^{163}:\\ \;\;\;\;\frac{y - z}{a - z} \cdot \left(t - x\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;z \le -6.3409255795068648 \cdot 10^{216}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\

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

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

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

\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 ((z <= -6.340925579506865e+216)) {
		VAR = ((double) fma(((double) (x / z)), y, ((double) (t - ((double) (((double) (t * y)) / z))))));
	} else {
		double VAR_1;
		if ((z <= 8.482328112026546e-274)) {
			VAR_1 = ((double) (((double) (y / ((double) (((double) (a - z)) / ((double) (t - x)))))) - ((double) (((double) (z / ((double) (((double) (a - z)) / ((double) (t - x)))))) - x))));
		} else {
			double VAR_2;
			if ((z <= 1.0048489443141935e+163)) {
				VAR_2 = ((double) (((double) (((double) (((double) (y - z)) / ((double) (a - z)))) * ((double) (t - x)))) + x));
			} else {
				VAR_2 = ((double) fma(((double) (x / z)), y, ((double) (t - ((double) (((double) (t * y)) / z))))));
			}
			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 z < -6.340925579506865e+216 or 1.0048489443141935e+163 < z

    1. Initial program 29.2

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)}\]
    3. Using strategy rm
    4. Applied div-inv29.2

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\left(t - x\right) \cdot \frac{1}{a - z}}, x\right)\]
    5. Taylor expanded around inf 24.4

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

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

    if -6.340925579506865e+216 < z < 8.482328112026546e-274

    1. Initial program 11.2

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity11.2

      \[\leadsto \mathsf{fma}\left(y - z, \frac{t - x}{\color{blue}{1 \cdot \left(a - z\right)}}, x\right)\]
    5. Applied add-cube-cbrt11.8

      \[\leadsto \mathsf{fma}\left(y - z, \frac{\color{blue}{\left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right) \cdot \sqrt[3]{t - x}}}{1 \cdot \left(a - z\right)}, x\right)\]
    6. Applied times-frac11.8

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{1} \cdot \frac{\sqrt[3]{t - x}}{a - z}}, x\right)\]
    7. Simplified11.8

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right)} \cdot \frac{\sqrt[3]{t - x}}{a - z}, x\right)\]
    8. Using strategy rm
    9. Applied fma-udef11.8

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right) \cdot \frac{\sqrt[3]{t - x}}{a - z}\right) + x}\]
    10. Simplified11.0

      \[\leadsto \color{blue}{\frac{y - z}{\frac{a - z}{t - x}}} + x\]
    11. Using strategy rm
    12. Applied div-sub11.0

      \[\leadsto \color{blue}{\left(\frac{y}{\frac{a - z}{t - x}} - \frac{z}{\frac{a - z}{t - x}}\right)} + x\]
    13. Applied associate-+l-9.1

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

    if 8.482328112026546e-274 < z < 1.0048489443141935e+163

    1. Initial program 9.9

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity9.8

      \[\leadsto \mathsf{fma}\left(y - z, \frac{t - x}{\color{blue}{1 \cdot \left(a - z\right)}}, x\right)\]
    5. Applied add-cube-cbrt10.4

      \[\leadsto \mathsf{fma}\left(y - z, \frac{\color{blue}{\left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right) \cdot \sqrt[3]{t - x}}}{1 \cdot \left(a - z\right)}, x\right)\]
    6. Applied times-frac10.4

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{1} \cdot \frac{\sqrt[3]{t - x}}{a - z}}, x\right)\]
    7. Simplified10.4

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right)} \cdot \frac{\sqrt[3]{t - x}}{a - z}, x\right)\]
    8. Using strategy rm
    9. Applied fma-udef10.4

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right) \cdot \frac{\sqrt[3]{t - x}}{a - z}\right) + x}\]
    10. Simplified9.7

      \[\leadsto \color{blue}{\frac{y - z}{\frac{a - z}{t - x}}} + x\]
    11. Using strategy rm
    12. Applied associate-/r/7.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -6.3409255795068648 \cdot 10^{216}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \mathbf{elif}\;z \le 8.482328112026546 \cdot 10^{-274}:\\ \;\;\;\;\frac{y}{\frac{a - z}{t - x}} - \left(\frac{z}{\frac{a - z}{t - x}} - x\right)\\ \mathbf{elif}\;z \le 1.0048489443141935 \cdot 10^{163}:\\ \;\;\;\;\frac{y - z}{a - z} \cdot \left(t - x\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020121 +o rules:numerics
(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)))))