
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * ((t - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * ((t - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x t) (- z a))) (t_2 (- x (* (- z y) t_1))))
(if (<= t_2 -5e-227)
t_2
(if (<= t_2 0.0) (- t (* (- a y) (/ (- x t) z))) (fma t_1 (- y z) x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - t) / (z - a);
double t_2 = x - ((z - y) * t_1);
double tmp;
if (t_2 <= -5e-227) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t - ((a - y) * ((x - t) / z));
} else {
tmp = fma(t_1, (y - z), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x - t) / Float64(z - a)) t_2 = Float64(x - Float64(Float64(z - y) * t_1)) tmp = 0.0 if (t_2 <= -5e-227) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(t - Float64(Float64(a - y) * Float64(Float64(x - t) / z))); else tmp = fma(t_1, Float64(y - z), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(z - y), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-227], t$95$2, If[LessEqual[t$95$2, 0.0], N[(t - N[(N[(a - y), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - t}{z - a}\\
t_2 := x - \left(z - y\right) \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-227}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t - \left(a - y\right) \cdot \frac{x - t}{z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.99999999999999961e-227Initial program 91.6%
if -4.99999999999999961e-227 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 11.2%
lift-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/l/N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6410.4
Applied rewrites10.4%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6492.6
Applied rewrites92.6%
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 89.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6489.2
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6489.2
Applied rewrites89.2%
Final simplification90.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x t) (- z a)))
(t_2 (fma t_1 (- y z) x))
(t_3 (- x (* (- z y) t_1))))
(if (<= t_3 -5e-227)
t_2
(if (<= t_3 0.0) (- t (* (- a y) (/ (- x t) z))) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - t) / (z - a);
double t_2 = fma(t_1, (y - z), x);
double t_3 = x - ((z - y) * t_1);
double tmp;
if (t_3 <= -5e-227) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = t - ((a - y) * ((x - t) / z));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x - t) / Float64(z - a)) t_2 = fma(t_1, Float64(y - z), x) t_3 = Float64(x - Float64(Float64(z - y) * t_1)) tmp = 0.0 if (t_3 <= -5e-227) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(t - Float64(Float64(a - y) * Float64(Float64(x - t) / z))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(N[(z - y), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-227], t$95$2, If[LessEqual[t$95$3, 0.0], N[(t - N[(N[(a - y), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - t}{z - a}\\
t_2 := \mathsf{fma}\left(t\_1, y - z, x\right)\\
t_3 := x - \left(z - y\right) \cdot t\_1\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-227}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t - \left(a - y\right) \cdot \frac{x - t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.99999999999999961e-227 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 90.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6490.5
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6490.5
Applied rewrites90.5%
if -4.99999999999999961e-227 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 11.2%
lift-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/l/N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6410.4
Applied rewrites10.4%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6492.6
Applied rewrites92.6%
Final simplification90.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- t x) x)))
(if (<= t -2.5e-187)
t_1
(if (<= t 4.05e+15)
(* (/ (- y a) z) x)
(if (<= t 3e+124) t_1 (* (/ (- y z) a) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) + x;
double tmp;
if (t <= -2.5e-187) {
tmp = t_1;
} else if (t <= 4.05e+15) {
tmp = ((y - a) / z) * x;
} else if (t <= 3e+124) {
tmp = t_1;
} else {
tmp = ((y - z) / a) * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (t - x) + x
if (t <= (-2.5d-187)) then
tmp = t_1
else if (t <= 4.05d+15) then
tmp = ((y - a) / z) * x
else if (t <= 3d+124) then
tmp = t_1
else
tmp = ((y - z) / a) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) + x;
double tmp;
if (t <= -2.5e-187) {
tmp = t_1;
} else if (t <= 4.05e+15) {
tmp = ((y - a) / z) * x;
} else if (t <= 3e+124) {
tmp = t_1;
} else {
tmp = ((y - z) / a) * t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t - x) + x tmp = 0 if t <= -2.5e-187: tmp = t_1 elif t <= 4.05e+15: tmp = ((y - a) / z) * x elif t <= 3e+124: tmp = t_1 else: tmp = ((y - z) / a) * t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) + x) tmp = 0.0 if (t <= -2.5e-187) tmp = t_1; elseif (t <= 4.05e+15) tmp = Float64(Float64(Float64(y - a) / z) * x); elseif (t <= 3e+124) tmp = t_1; else tmp = Float64(Float64(Float64(y - z) / a) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t - x) + x; tmp = 0.0; if (t <= -2.5e-187) tmp = t_1; elseif (t <= 4.05e+15) tmp = ((y - a) / z) * x; elseif (t <= 3e+124) tmp = t_1; else tmp = ((y - z) / a) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -2.5e-187], t$95$1, If[LessEqual[t, 4.05e+15], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 3e+124], t$95$1, N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{-187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.05 \cdot 10^{+15}:\\
\;\;\;\;\frac{y - a}{z} \cdot x\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{a} \cdot t\\
\end{array}
\end{array}
if t < -2.4999999999999998e-187 or 4.05e15 < t < 3e124Initial program 88.3%
Taylor expanded in z around inf
lower--.f6437.0
Applied rewrites37.0%
if -2.4999999999999998e-187 < t < 4.05e15Initial program 70.0%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites58.5%
Taylor expanded in t around 0
Applied rewrites42.5%
if 3e124 < t Initial program 90.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6457.3
Applied rewrites57.3%
Taylor expanded in t around inf
Applied rewrites47.4%
Final simplification40.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y z) a) (- t x) x)))
(if (<= a -3e+54)
t_1
(if (<= a 9.5e-38) (fma (/ (- y a) z) (- x t) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - z) / a), (t - x), x);
double tmp;
if (a <= -3e+54) {
tmp = t_1;
} else if (a <= 9.5e-38) {
tmp = fma(((y - a) / z), (x - t), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - z) / a), Float64(t - x), x) tmp = 0.0 if (a <= -3e+54) tmp = t_1; elseif (a <= 9.5e-38) tmp = fma(Float64(Float64(y - a) / z), Float64(x - t), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3e+54], t$95$1, If[LessEqual[a, 9.5e-38], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{if}\;a \leq -3 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.9999999999999999e54 or 9.5000000000000009e-38 < a Initial program 92.4%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.0
Applied rewrites80.0%
if -2.9999999999999999e54 < a < 9.5000000000000009e-38Initial program 73.7%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites83.3%
Applied rewrites83.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) a) y x)))
(if (<= a -3e+54)
t_1
(if (<= a 1.85e-36) (fma (/ (- y a) z) (- x t) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / a), y, x);
double tmp;
if (a <= -3e+54) {
tmp = t_1;
} else if (a <= 1.85e-36) {
tmp = fma(((y - a) / z), (x - t), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / a), y, x) tmp = 0.0 if (a <= -3e+54) tmp = t_1; elseif (a <= 1.85e-36) tmp = fma(Float64(Float64(y - a) / z), Float64(x - t), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[a, -3e+54], t$95$1, If[LessEqual[a, 1.85e-36], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{if}\;a \leq -3 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{-36}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.9999999999999999e54 or 1.85000000000000001e-36 < a Initial program 92.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6470.4
Applied rewrites70.4%
if -2.9999999999999999e54 < a < 1.85000000000000001e-36Initial program 73.7%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites83.3%
Applied rewrites83.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ (- t x) a) y x))) (if (<= a -6.6e+56) t_1 (if (<= a 9.5e-38) (fma (/ (- x t) z) y t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / a), y, x);
double tmp;
if (a <= -6.6e+56) {
tmp = t_1;
} else if (a <= 9.5e-38) {
tmp = fma(((x - t) / z), y, t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / a), y, x) tmp = 0.0 if (a <= -6.6e+56) tmp = t_1; elseif (a <= 9.5e-38) tmp = fma(Float64(Float64(x - t) / z), y, t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[a, -6.6e+56], t$95$1, If[LessEqual[a, 9.5e-38], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{if}\;a \leq -6.6 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.60000000000000004e56 or 9.5000000000000009e-38 < a Initial program 92.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6471.0
Applied rewrites71.0%
if -6.60000000000000004e56 < a < 9.5000000000000009e-38Initial program 73.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites82.8%
Taylor expanded in a around 0
Applied rewrites74.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ y a) (- t x) x))) (if (<= a -6.6e+56) t_1 (if (<= a 9.5e-38) (fma (/ (- x t) z) y t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / a), (t - x), x);
double tmp;
if (a <= -6.6e+56) {
tmp = t_1;
} else if (a <= 9.5e-38) {
tmp = fma(((x - t) / z), y, t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / a), Float64(t - x), x) tmp = 0.0 if (a <= -6.6e+56) tmp = t_1; elseif (a <= 9.5e-38) tmp = fma(Float64(Float64(x - t) / z), y, t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -6.6e+56], t$95$1, If[LessEqual[a, 9.5e-38], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{if}\;a \leq -6.6 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.60000000000000004e56 or 9.5000000000000009e-38 < a Initial program 92.4%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Taylor expanded in z around 0
Applied rewrites71.0%
if -6.60000000000000004e56 < a < 9.5000000000000009e-38Initial program 73.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites82.8%
Taylor expanded in a around 0
Applied rewrites74.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ y a) (- x) x))) (if (<= a -6.6e+56) t_1 (if (<= a 2.45e+144) (fma (/ (- x t) z) y t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / a), -x, x);
double tmp;
if (a <= -6.6e+56) {
tmp = t_1;
} else if (a <= 2.45e+144) {
tmp = fma(((x - t) / z), y, t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / a), Float64(-x), x) tmp = 0.0 if (a <= -6.6e+56) tmp = t_1; elseif (a <= 2.45e+144) tmp = fma(Float64(Float64(x - t) / z), y, t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * (-x) + x), $MachinePrecision]}, If[LessEqual[a, -6.6e+56], t$95$1, If[LessEqual[a, 2.45e+144], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{a}, -x, x\right)\\
\mathbf{if}\;a \leq -6.6 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.45 \cdot 10^{+144}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.60000000000000004e56 or 2.45e144 < a Initial program 92.4%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6487.6
Applied rewrites87.6%
Taylor expanded in t around 0
Applied rewrites56.9%
Taylor expanded in z around 0
Applied rewrites57.1%
if -6.60000000000000004e56 < a < 2.45e144Initial program 77.2%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites76.0%
Taylor expanded in a around 0
Applied rewrites69.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (- t x) x))) (if (<= z -1.7e+91) t_1 (if (<= z 6.5e+38) (fma (/ y a) (- x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) + x;
double tmp;
if (z <= -1.7e+91) {
tmp = t_1;
} else if (z <= 6.5e+38) {
tmp = fma((y / a), -x, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) + x) tmp = 0.0 if (z <= -1.7e+91) tmp = t_1; elseif (z <= 6.5e+38) tmp = fma(Float64(y / a), Float64(-x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.7e+91], t$95$1, If[LessEqual[z, 6.5e+38], N[(N[(y / a), $MachinePrecision] * (-x) + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, -x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.7e91 or 6.5e38 < z Initial program 66.7%
Taylor expanded in z around inf
lower--.f6445.7
Applied rewrites45.7%
if -1.7e91 < z < 6.5e38Initial program 92.7%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6469.2
Applied rewrites69.2%
Taylor expanded in t around 0
Applied rewrites49.3%
Taylor expanded in z around 0
Applied rewrites49.2%
Final simplification47.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ (- y a) z) x))) (if (<= x -12.6) t_1 (if (<= x 1.55e+86) (+ (- t x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - a) / z) * x;
double tmp;
if (x <= -12.6) {
tmp = t_1;
} else if (x <= 1.55e+86) {
tmp = (t - x) + x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((y - a) / z) * x
if (x <= (-12.6d0)) then
tmp = t_1
else if (x <= 1.55d+86) then
tmp = (t - x) + x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - a) / z) * x;
double tmp;
if (x <= -12.6) {
tmp = t_1;
} else if (x <= 1.55e+86) {
tmp = (t - x) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - a) / z) * x tmp = 0 if x <= -12.6: tmp = t_1 elif x <= 1.55e+86: tmp = (t - x) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - a) / z) * x) tmp = 0.0 if (x <= -12.6) tmp = t_1; elseif (x <= 1.55e+86) tmp = Float64(Float64(t - x) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - a) / z) * x; tmp = 0.0; if (x <= -12.6) tmp = t_1; elseif (x <= 1.55e+86) tmp = (t - x) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -12.6], t$95$1, If[LessEqual[x, 1.55e+86], N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - a}{z} \cdot x\\
\mathbf{if}\;x \leq -12.6:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+86}:\\
\;\;\;\;\left(t - x\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -12.5999999999999996 or 1.5500000000000001e86 < x Initial program 77.4%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites57.6%
Taylor expanded in t around 0
Applied rewrites43.8%
if -12.5999999999999996 < x < 1.5500000000000001e86Initial program 84.5%
Taylor expanded in z around inf
lower--.f6434.4
Applied rewrites34.4%
Final simplification37.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y z) x))) (if (<= y -4.2e+44) t_1 (if (<= y 2.9e+99) (+ (- t x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / z) * x;
double tmp;
if (y <= -4.2e+44) {
tmp = t_1;
} else if (y <= 2.9e+99) {
tmp = (t - x) + x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y / z) * x
if (y <= (-4.2d+44)) then
tmp = t_1
else if (y <= 2.9d+99) then
tmp = (t - x) + x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y / z) * x;
double tmp;
if (y <= -4.2e+44) {
tmp = t_1;
} else if (y <= 2.9e+99) {
tmp = (t - x) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / z) * x tmp = 0 if y <= -4.2e+44: tmp = t_1 elif y <= 2.9e+99: tmp = (t - x) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / z) * x) tmp = 0.0 if (y <= -4.2e+44) tmp = t_1; elseif (y <= 2.9e+99) tmp = Float64(Float64(t - x) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / z) * x; tmp = 0.0; if (y <= -4.2e+44) tmp = t_1; elseif (y <= 2.9e+99) tmp = (t - x) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -4.2e+44], t$95$1, If[LessEqual[y, 2.9e+99], N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} \cdot x\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+99}:\\
\;\;\;\;\left(t - x\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.19999999999999974e44 or 2.9000000000000002e99 < y Initial program 86.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6486.6
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6486.6
Applied rewrites86.6%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6463.0
Applied rewrites63.0%
Taylor expanded in a around 0
Applied rewrites43.3%
Taylor expanded in t around 0
Applied rewrites42.1%
if -4.19999999999999974e44 < y < 2.9000000000000002e99Initial program 79.3%
Taylor expanded in z around inf
lower--.f6431.6
Applied rewrites31.6%
Final simplification35.3%
(FPCore (x y z t a) :precision binary64 (+ (- t x) x))
double code(double x, double y, double z, double t, double a) {
return (t - x) + x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (t - x) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (t - x) + x;
}
def code(x, y, z, t, a): return (t - x) + x
function code(x, y, z, t, a) return Float64(Float64(t - x) + x) end
function tmp = code(x, y, z, t, a) tmp = (t - x) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(t - x\right) + x
\end{array}
Initial program 81.8%
Taylor expanded in z around inf
lower--.f6425.0
Applied rewrites25.0%
Final simplification25.0%
(FPCore (x y z t a) :precision binary64 (+ (- x) x))
double code(double x, double y, double z, double t, double a) {
return -x + x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = -x + x
end function
public static double code(double x, double y, double z, double t, double a) {
return -x + x;
}
def code(x, y, z, t, a): return -x + x
function code(x, y, z, t, a) return Float64(Float64(-x) + x) end
function tmp = code(x, y, z, t, a) tmp = -x + x; end
code[x_, y_, z_, t_, a_] := N[((-x) + x), $MachinePrecision]
\begin{array}{l}
\\
\left(-x\right) + x
\end{array}
Initial program 81.8%
Taylor expanded in z around inf
lower--.f6425.0
Applied rewrites25.0%
Taylor expanded in t around 0
Applied rewrites3.0%
Final simplification3.0%
herbie shell --seed 2024268
(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)))))