
(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 14 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 (+ (* (/ (- t x) (- a z)) (- y z)) x)))
(if (<= t_1 -2e-264)
(+ (/ (- y z) (/ (- z a) (- x t))) x)
(if (<= t_1 0.0) (fma (/ (- x t) z) (- y a) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (((t - x) / (a - z)) * (y - z)) + x;
double tmp;
if (t_1 <= -2e-264) {
tmp = ((y - z) / ((z - a) / (x - t))) + x;
} else if (t_1 <= 0.0) {
tmp = fma(((x - t) / z), (y - a), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(Float64(t - x) / Float64(a - z)) * Float64(y - z)) + x) tmp = 0.0 if (t_1 <= -2e-264) tmp = Float64(Float64(Float64(y - z) / Float64(Float64(z - a) / Float64(x - t))) + x); elseif (t_1 <= 0.0) tmp = fma(Float64(Float64(x - t) / z), Float64(y - a), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-264], N[(N[(N[(y - z), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z} \cdot \left(y - z\right) + x\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-264}:\\
\;\;\;\;\frac{y - z}{\frac{z - a}{x - t}} + x\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y - a, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2e-264Initial program 92.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.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--.f6492.3
Applied rewrites92.3%
if -2e-264 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 3.6%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f642.0
Applied rewrites2.0%
Applied rewrites2.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.8%
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 94.9%
Final simplification94.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* (/ (- t x) (- a z)) (- y z)) x)))
(if (<= t_1 -2e-264)
t_1
(if (<= t_1 0.0) (fma (/ (- x t) z) (- y a) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (((t - x) / (a - z)) * (y - z)) + x;
double tmp;
if (t_1 <= -2e-264) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = fma(((x - t) / z), (y - a), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(Float64(t - x) / Float64(a - z)) * Float64(y - z)) + x) tmp = 0.0 if (t_1 <= -2e-264) tmp = t_1; elseif (t_1 <= 0.0) tmp = fma(Float64(Float64(x - t) / z), Float64(y - a), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-264], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z} \cdot \left(y - z\right) + x\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-264}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y - a, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2e-264 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 93.7%
if -2e-264 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 3.6%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f642.0
Applied rewrites2.0%
Applied rewrites2.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.8%
Final simplification94.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) a) x)))
(if (<= a -5.9e-119)
t_1
(if (<= a -1.95e-305)
(* (- 1.0 (/ y z)) t)
(if (<= a 3.5e-11) (* (/ y (- a z)) (- t x)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / a), x);
double tmp;
if (a <= -5.9e-119) {
tmp = t_1;
} else if (a <= -1.95e-305) {
tmp = (1.0 - (y / z)) * t;
} else if (a <= 3.5e-11) {
tmp = (y / (a - z)) * (t - x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -5.9e-119) tmp = t_1; elseif (a <= -1.95e-305) tmp = Float64(Float64(1.0 - Float64(y / z)) * t); elseif (a <= 3.5e-11) tmp = Float64(Float64(y / Float64(a - z)) * Float64(t - x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5.9e-119], t$95$1, If[LessEqual[a, -1.95e-305], N[(N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[a, 3.5e-11], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -5.9 \cdot 10^{-119}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.95 \cdot 10^{-305}:\\
\;\;\;\;\left(1 - \frac{y}{z}\right) \cdot t\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-11}:\\
\;\;\;\;\frac{y}{a - z} \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.9000000000000002e-119 or 3.50000000000000019e-11 < a Initial program 91.6%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6477.7
Applied rewrites77.7%
if -5.9000000000000002e-119 < a < -1.95000000000000013e-305Initial program 73.7%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6475.8
Applied rewrites75.8%
Taylor expanded in t around inf
Applied rewrites81.6%
Taylor expanded in t around inf
Applied rewrites81.6%
if -1.95000000000000013e-305 < a < 3.50000000000000019e-11Initial program 71.6%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6460.2
Applied rewrites60.2%
Final simplification73.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) a) y x)))
(if (<= a -6400000.0)
t_1
(if (<= a -1.95e-305)
(* (- 1.0 (/ y z)) t)
(if (<= a 3.5e-11) (* (/ y (- a z)) (- t x)) 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 <= -6400000.0) {
tmp = t_1;
} else if (a <= -1.95e-305) {
tmp = (1.0 - (y / z)) * t;
} else if (a <= 3.5e-11) {
tmp = (y / (a - z)) * (t - x);
} 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 <= -6400000.0) tmp = t_1; elseif (a <= -1.95e-305) tmp = Float64(Float64(1.0 - Float64(y / z)) * t); elseif (a <= 3.5e-11) tmp = Float64(Float64(y / Float64(a - z)) * Float64(t - x)); 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, -6400000.0], t$95$1, If[LessEqual[a, -1.95e-305], N[(N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[a, 3.5e-11], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision]), $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 -6400000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.95 \cdot 10^{-305}:\\
\;\;\;\;\left(1 - \frac{y}{z}\right) \cdot t\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-11}:\\
\;\;\;\;\frac{y}{a - z} \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.4e6 or 3.50000000000000019e-11 < a Initial program 94.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6475.4
Applied rewrites75.4%
if -6.4e6 < a < -1.95000000000000013e-305Initial program 74.8%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6464.9
Applied rewrites64.9%
Taylor expanded in t around inf
Applied rewrites65.4%
Taylor expanded in t around inf
Applied rewrites65.4%
if -1.95000000000000013e-305 < a < 3.50000000000000019e-11Initial program 71.6%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6460.2
Applied rewrites60.2%
Final simplification69.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -260000000.0)
(fma (- y z) (/ (- t x) a) x)
(if (<= a 2.15e-10)
(fma (/ (- x t) z) (- y a) t)
(+ (* (/ (- y z) a) (- t x)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -260000000.0) {
tmp = fma((y - z), ((t - x) / a), x);
} else if (a <= 2.15e-10) {
tmp = fma(((x - t) / z), (y - a), t);
} else {
tmp = (((y - z) / a) * (t - x)) + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -260000000.0) tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); elseif (a <= 2.15e-10) tmp = fma(Float64(Float64(x - t) / z), Float64(y - a), t); else tmp = Float64(Float64(Float64(Float64(y - z) / a) * Float64(t - x)) + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -260000000.0], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 2.15e-10], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], N[(N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -260000000:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{elif}\;a \leq 2.15 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y - a, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{a} \cdot \left(t - x\right) + x\\
\end{array}
\end{array}
if a < -2.6e8Initial program 95.5%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6485.1
Applied rewrites85.1%
if -2.6e8 < a < 2.15000000000000007e-10Initial program 73.1%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6432.5
Applied rewrites32.5%
Applied rewrites33.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites79.6%
if 2.15000000000000007e-10 < a Initial program 92.6%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.8
Applied rewrites83.8%
Final simplification82.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) a) x)))
(if (<= a -260000000.0)
t_1
(if (<= a 2.15e-10) (fma (/ (- x t) z) (- y a) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / a), x);
double tmp;
if (a <= -260000000.0) {
tmp = t_1;
} else if (a <= 2.15e-10) {
tmp = fma(((x - t) / z), (y - a), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -260000000.0) tmp = t_1; elseif (a <= 2.15e-10) tmp = fma(Float64(Float64(x - t) / z), Float64(y - a), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -260000000.0], t$95$1, If[LessEqual[a, 2.15e-10], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -260000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.15 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y - a, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.6e8 or 2.15000000000000007e-10 < a Initial program 94.1%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6483.8
Applied rewrites83.8%
if -2.6e8 < a < 2.15000000000000007e-10Initial program 73.1%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6432.5
Applied rewrites32.5%
Applied rewrites33.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites79.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ t (- a z)) (- y z)))) (if (<= t -2.6e-42) t_1 (if (<= t 1.2e+31) (fma (/ (- t x) a) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t / (a - z)) * (y - z);
double tmp;
if (t <= -2.6e-42) {
tmp = t_1;
} else if (t <= 1.2e+31) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t / Float64(a - z)) * Float64(y - z)) tmp = 0.0 if (t <= -2.6e-42) tmp = t_1; elseif (t <= 1.2e+31) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.6e-42], t$95$1, If[LessEqual[t, 1.2e+31], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{a - z} \cdot \left(y - z\right)\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.6e-42 or 1.19999999999999991e31 < t Initial program 91.2%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6475.7
Applied rewrites75.7%
if -2.6e-42 < t < 1.19999999999999991e31Initial program 75.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6459.2
Applied rewrites59.2%
Final simplification67.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ (- t x) a) y x))) (if (<= a -6400000.0) t_1 (if (<= a 7.8e-75) (* (- 1.0 (/ y z)) 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 <= -6400000.0) {
tmp = t_1;
} else if (a <= 7.8e-75) {
tmp = (1.0 - (y / z)) * 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 <= -6400000.0) tmp = t_1; elseif (a <= 7.8e-75) tmp = Float64(Float64(1.0 - Float64(y / z)) * 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, -6400000.0], t$95$1, If[LessEqual[a, 7.8e-75], N[(N[(1.0 - N[(y / z), $MachinePrecision]), $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 -6400000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{-75}:\\
\;\;\;\;\left(1 - \frac{y}{z}\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.4e6 or 7.8000000000000003e-75 < a Initial program 91.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6472.3
Applied rewrites72.3%
if -6.4e6 < a < 7.8000000000000003e-75Initial program 73.3%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6466.4
Applied rewrites66.4%
Taylor expanded in t around inf
Applied rewrites60.4%
Taylor expanded in t around inf
Applied rewrites60.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ y a) (- t x) x))) (if (<= a -6400000.0) t_1 (if (<= a 7.8e-75) (* (- 1.0 (/ y z)) 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 <= -6400000.0) {
tmp = t_1;
} else if (a <= 7.8e-75) {
tmp = (1.0 - (y / z)) * 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 <= -6400000.0) tmp = t_1; elseif (a <= 7.8e-75) tmp = Float64(Float64(1.0 - Float64(y / z)) * 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, -6400000.0], t$95$1, If[LessEqual[a, 7.8e-75], N[(N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] * 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 -6400000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{-75}:\\
\;\;\;\;\left(1 - \frac{y}{z}\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.4e6 or 7.8000000000000003e-75 < a Initial program 91.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6472.3
Applied rewrites72.3%
Applied rewrites72.3%
if -6.4e6 < a < 7.8000000000000003e-75Initial program 73.3%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6466.4
Applied rewrites66.4%
Taylor expanded in t around inf
Applied rewrites60.4%
Taylor expanded in t around inf
Applied rewrites60.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ t a) y x))) (if (<= a -1.12e+32) t_1 (if (<= a 5.7e-34) (* (- 1.0 (/ y z)) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t / a), y, x);
double tmp;
if (a <= -1.12e+32) {
tmp = t_1;
} else if (a <= 5.7e-34) {
tmp = (1.0 - (y / z)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t / a), y, x) tmp = 0.0 if (a <= -1.12e+32) tmp = t_1; elseif (a <= 5.7e-34) tmp = Float64(Float64(1.0 - Float64(y / z)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[a, -1.12e+32], t$95$1, If[LessEqual[a, 5.7e-34], N[(N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{if}\;a \leq -1.12 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.7 \cdot 10^{-34}:\\
\;\;\;\;\left(1 - \frac{y}{z}\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.12000000000000007e32 or 5.69999999999999974e-34 < a Initial program 91.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6472.2
Applied rewrites72.2%
Taylor expanded in t around inf
Applied rewrites65.3%
if -1.12000000000000007e32 < a < 5.69999999999999974e-34Initial program 75.0%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6465.4
Applied rewrites65.4%
Taylor expanded in t around inf
Applied rewrites59.2%
Taylor expanded in t around inf
Applied rewrites59.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (- t x) x))) (if (<= z -1.22e+175) t_1 (if (<= z 3.8e+141) (fma (/ t a) y 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.22e+175) {
tmp = t_1;
} else if (z <= 3.8e+141) {
tmp = fma((t / a), y, 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.22e+175) tmp = t_1; elseif (z <= 3.8e+141) tmp = fma(Float64(t / a), y, 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.22e+175], t$95$1, If[LessEqual[z, 3.8e+141], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -1.22 \cdot 10^{+175}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+141}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.22e175 or 3.79999999999999976e141 < z Initial program 63.8%
Taylor expanded in z around inf
lower--.f6451.7
Applied rewrites51.7%
if -1.22e175 < z < 3.79999999999999976e141Initial program 89.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6465.9
Applied rewrites65.9%
Taylor expanded in t around inf
Applied rewrites55.2%
Final simplification54.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (- t x) x))) (if (<= z -1.22e+160) t_1 (if (<= z 2.9e+56) (* (/ y a) t) 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.22e+160) {
tmp = t_1;
} else if (z <= 2.9e+56) {
tmp = (y / a) * t;
} 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 = (t - x) + x
if (z <= (-1.22d+160)) then
tmp = t_1
else if (z <= 2.9d+56) then
tmp = (y / a) * t
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 = (t - x) + x;
double tmp;
if (z <= -1.22e+160) {
tmp = t_1;
} else if (z <= 2.9e+56) {
tmp = (y / a) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t - x) + x tmp = 0 if z <= -1.22e+160: tmp = t_1 elif z <= 2.9e+56: tmp = (y / a) * t 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.22e+160) tmp = t_1; elseif (z <= 2.9e+56) tmp = Float64(Float64(y / a) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t - x) + x; tmp = 0.0; if (z <= -1.22e+160) tmp = t_1; elseif (z <= 2.9e+56) tmp = (y / a) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.22e+160], t$95$1, If[LessEqual[z, 2.9e+56], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -1.22 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+56}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.22e160 or 2.90000000000000007e56 < z Initial program 69.4%
Taylor expanded in z around inf
lower--.f6442.0
Applied rewrites42.0%
if -1.22e160 < z < 2.90000000000000007e56Initial program 90.0%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6440.3
Applied rewrites40.3%
Taylor expanded in z around 0
Applied rewrites21.3%
Applied rewrites28.5%
Final simplification32.5%
(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 83.8%
Taylor expanded in z around inf
lower--.f6418.6
Applied rewrites18.6%
Final simplification18.6%
(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 83.8%
Taylor expanded in z around inf
lower--.f6418.6
Applied rewrites18.6%
Taylor expanded in t around 0
Applied rewrites2.6%
Final simplification2.6%
herbie shell --seed 2024235
(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)))))