
(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 (+ (/ (- y z) (/ (- z a) (- x t))) x))
(t_2 (+ (* (/ (- t x) (- a z)) (- y z)) x)))
(if (<= t_2 -200000000.0)
t_1
(if (<= t_2 -5e-276)
(+ (/ (* (- x t) (- y z)) (- z a)) x)
(if (<= t_2 0.0) (fma (/ (- y a) z) (- x t) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) / ((z - a) / (x - t))) + x;
double t_2 = (((t - x) / (a - z)) * (y - z)) + x;
double tmp;
if (t_2 <= -200000000.0) {
tmp = t_1;
} else if (t_2 <= -5e-276) {
tmp = (((x - t) * (y - z)) / (z - a)) + x;
} else if (t_2 <= 0.0) {
tmp = fma(((y - a) / z), (x - t), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) / Float64(Float64(z - a) / Float64(x - t))) + x) t_2 = Float64(Float64(Float64(Float64(t - x) / Float64(a - z)) * Float64(y - z)) + x) tmp = 0.0 if (t_2 <= -200000000.0) tmp = t_1; elseif (t_2 <= -5e-276) tmp = Float64(Float64(Float64(Float64(x - t) * Float64(y - z)) / Float64(z - a)) + x); elseif (t_2 <= 0.0) 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] / N[(N[(z - a), $MachinePrecision] / N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$2, -200000000.0], t$95$1, If[LessEqual[t$95$2, -5e-276], N[(N[(N[(N[(x - t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$2, 0.0], 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 := \frac{y - z}{\frac{z - a}{x - t}} + x\\
t_2 := \frac{t - x}{a - z} \cdot \left(y - z\right) + x\\
\mathbf{if}\;t\_2 \leq -200000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-276}:\\
\;\;\;\;\frac{\left(x - t\right) \cdot \left(y - z\right)}{z - a} + x\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2e8 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.7%
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.5
Applied rewrites92.5%
if -2e8 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.99999999999999967e-276Initial program 79.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-2negN/A
lower-/.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/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--.f6493.9
Applied rewrites93.9%
if -4.99999999999999967e-276 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 3.6%
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 rewrites96.5%
Applied rewrites96.5%
Final simplification93.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x t) (- z a)) (- y z) x))
(t_2 (+ (* (/ (- t x) (- a z)) (- y z)) x)))
(if (<= t_2 -2e-28)
t_1
(if (<= t_2 -5e-276)
(+ (/ (* (- x t) (- y z)) (- z a)) x)
(if (<= t_2 0.0) (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(((x - t) / (z - a)), (y - z), x);
double t_2 = (((t - x) / (a - z)) * (y - z)) + x;
double tmp;
if (t_2 <= -2e-28) {
tmp = t_1;
} else if (t_2 <= -5e-276) {
tmp = (((x - t) * (y - z)) / (z - a)) + x;
} else if (t_2 <= 0.0) {
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(x - t) / Float64(z - a)), Float64(y - z), x) t_2 = Float64(Float64(Float64(Float64(t - x) / Float64(a - z)) * Float64(y - z)) + x) tmp = 0.0 if (t_2 <= -2e-28) tmp = t_1; elseif (t_2 <= -5e-276) tmp = Float64(Float64(Float64(Float64(x - t) * Float64(y - z)) / Float64(z - a)) + x); elseif (t_2 <= 0.0) 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[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-28], t$95$1, If[LessEqual[t$95$2, -5e-276], N[(N[(N[(N[(x - t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$2, 0.0], 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{x - t}{z - a}, y - z, x\right)\\
t_2 := \frac{t - x}{a - z} \cdot \left(y - z\right) + x\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-276}:\\
\;\;\;\;\frac{\left(x - t\right) \cdot \left(y - z\right)}{z - a} + x\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.99999999999999994e-28 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6491.9
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--.f6491.9
Applied rewrites91.9%
if -1.99999999999999994e-28 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.99999999999999967e-276Initial program 74.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-2negN/A
lower-/.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/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.7
Applied rewrites92.7%
if -4.99999999999999967e-276 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 3.6%
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 rewrites96.5%
Applied rewrites96.5%
Final simplification92.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x t) (- z a)) (- y z) x))
(t_2 (+ (* (/ (- t x) (- a z)) (- y z)) x)))
(if (<= t_2 -1e-243)
t_1
(if (<= t_2 0.0) (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(((x - t) / (z - a)), (y - z), x);
double t_2 = (((t - x) / (a - z)) * (y - z)) + x;
double tmp;
if (t_2 <= -1e-243) {
tmp = t_1;
} else if (t_2 <= 0.0) {
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(x - t) / Float64(z - a)), Float64(y - z), x) t_2 = Float64(Float64(Float64(Float64(t - x) / Float64(a - z)) * Float64(y - z)) + x) tmp = 0.0 if (t_2 <= -1e-243) tmp = t_1; elseif (t_2 <= 0.0) 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[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-243], t$95$1, If[LessEqual[t$95$2, 0.0], 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{x - t}{z - a}, y - z, x\right)\\
t_2 := \frac{t - x}{a - z} \cdot \left(y - z\right) + x\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-243}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.99999999999999995e-244 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6491.3
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--.f6491.3
Applied rewrites91.3%
if -9.99999999999999995e-244 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 7.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 rewrites87.9%
Applied rewrites87.9%
Final simplification90.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x t) z) y t)))
(if (<= z -6.2e-103)
t_1
(if (<= z 4e-215)
(/ (* (- t x) y) a)
(if (<= z 1.08e-70) (* (/ y (- a z)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - t) / z), y, t);
double tmp;
if (z <= -6.2e-103) {
tmp = t_1;
} else if (z <= 4e-215) {
tmp = ((t - x) * y) / a;
} else if (z <= 1.08e-70) {
tmp = (y / (a - z)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - t) / z), y, t) tmp = 0.0 if (z <= -6.2e-103) tmp = t_1; elseif (z <= 4e-215) tmp = Float64(Float64(Float64(t - x) * y) / a); elseif (z <= 1.08e-70) tmp = Float64(Float64(y / Float64(a - z)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision]}, If[LessEqual[z, -6.2e-103], t$95$1, If[LessEqual[z, 4e-215], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 1.08e-70], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{-103}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-215}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a}\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{-70}:\\
\;\;\;\;\frac{y}{a - z} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.2000000000000003e-103 or 1.0800000000000001e-70 < z Initial program 76.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 rewrites70.7%
Taylor expanded in a around 0
Applied rewrites65.5%
if -6.2000000000000003e-103 < z < 4.00000000000000017e-215Initial program 86.2%
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--.f6483.3
Applied rewrites83.3%
Taylor expanded in y around inf
Applied rewrites54.1%
if 4.00000000000000017e-215 < z < 1.0800000000000001e-70Initial program 92.1%
Taylor expanded in t 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--.f6452.2
Applied rewrites52.2%
Taylor expanded in y around inf
Applied rewrites52.1%
Final simplification61.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x z) y t)))
(if (<= z -2.5e-90)
t_1
(if (<= z 9.6e-226)
(/ (* (- t x) y) a)
(if (<= z 4.1e-70) (* (/ y (- a z)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / z), y, t);
double tmp;
if (z <= -2.5e-90) {
tmp = t_1;
} else if (z <= 9.6e-226) {
tmp = ((t - x) * y) / a;
} else if (z <= 4.1e-70) {
tmp = (y / (a - z)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / z), y, t) tmp = 0.0 if (z <= -2.5e-90) tmp = t_1; elseif (z <= 9.6e-226) tmp = Float64(Float64(Float64(t - x) * y) / a); elseif (z <= 4.1e-70) tmp = Float64(Float64(y / Float64(a - z)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * y + t), $MachinePrecision]}, If[LessEqual[z, -2.5e-90], t$95$1, If[LessEqual[z, 9.6e-226], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 4.1e-70], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{z}, y, t\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-226}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-70}:\\
\;\;\;\;\frac{y}{a - z} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.5000000000000001e-90 or 4.09999999999999977e-70 < z Initial program 76.3%
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 rewrites70.7%
Applied rewrites70.7%
Taylor expanded in a around 0
Applied rewrites65.5%
Taylor expanded in t around 0
Applied rewrites57.3%
if -2.5000000000000001e-90 < z < 9.5999999999999998e-226Initial program 88.5%
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--.f6482.0
Applied rewrites82.0%
Taylor expanded in y around inf
Applied rewrites55.0%
if 9.5999999999999998e-226 < z < 4.09999999999999977e-70Initial program 89.8%
Taylor expanded in t 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--.f6450.9
Applied rewrites50.9%
Taylor expanded in y around inf
Applied rewrites51.8%
Final simplification56.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ (- y z) a) (- t x) x))) (if (<= a -0.0034) t_1 (if (<= a 11.0) (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 <= -0.0034) {
tmp = t_1;
} else if (a <= 11.0) {
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 <= -0.0034) tmp = t_1; elseif (a <= 11.0) 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, -0.0034], t$95$1, If[LessEqual[a, 11.0], 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 -0.0034:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 11:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.00339999999999999981 or 11 < a Initial program 89.9%
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.3
Applied rewrites80.3%
if -0.00339999999999999981 < a < 11Initial program 71.3%
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.0%
Applied rewrites82.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -0.0055) (fma (/ (- t x) a) y x) (if (<= a 11.0) (fma (/ (- y a) z) (- x t) t) (fma (/ y a) (- t x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -0.0055) {
tmp = fma(((t - x) / a), y, x);
} else if (a <= 11.0) {
tmp = fma(((y - a) / z), (x - t), t);
} else {
tmp = fma((y / a), (t - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -0.0055) tmp = fma(Float64(Float64(t - x) / a), y, x); elseif (a <= 11.0) tmp = fma(Float64(Float64(y - a) / z), Float64(x - t), t); else tmp = fma(Float64(y / a), Float64(t - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -0.0055], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[a, 11.0], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.0055:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{elif}\;a \leq 11:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\end{array}
\end{array}
if a < -0.0054999999999999997Initial program 88.8%
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 -0.0054999999999999997 < a < 11Initial program 71.3%
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.0%
Applied rewrites82.0%
if 11 < a Initial program 91.2%
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--.f6483.6
Applied rewrites83.6%
Taylor expanded in z around 0
Applied rewrites79.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -0.0034) (fma (/ (- t x) a) y x) (if (<= a 11.0) (fma (/ (- x t) z) y t) (fma (/ y a) (- t x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -0.0034) {
tmp = fma(((t - x) / a), y, x);
} else if (a <= 11.0) {
tmp = fma(((x - t) / z), y, t);
} else {
tmp = fma((y / a), (t - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -0.0034) tmp = fma(Float64(Float64(t - x) / a), y, x); elseif (a <= 11.0) tmp = fma(Float64(Float64(x - t) / z), y, t); else tmp = fma(Float64(y / a), Float64(t - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -0.0034], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[a, 11.0], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.0034:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{elif}\;a \leq 11:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\end{array}
\end{array}
if a < -0.00339999999999999981Initial program 88.8%
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 -0.00339999999999999981 < a < 11Initial program 71.3%
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.0%
Taylor expanded in a around 0
Applied rewrites79.0%
if 11 < a Initial program 91.2%
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--.f6483.6
Applied rewrites83.6%
Taylor expanded in z around 0
Applied rewrites79.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ y a) (- t x) x))) (if (<= a -0.0034) t_1 (if (<= a 11.0) (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 <= -0.0034) {
tmp = t_1;
} else if (a <= 11.0) {
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 <= -0.0034) tmp = t_1; elseif (a <= 11.0) 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, -0.0034], t$95$1, If[LessEqual[a, 11.0], 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 -0.0034:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 11:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.00339999999999999981 or 11 < a Initial program 89.9%
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.3
Applied rewrites80.3%
Taylor expanded in z around 0
Applied rewrites74.2%
if -0.00339999999999999981 < a < 11Initial program 71.3%
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.0%
Taylor expanded in a around 0
Applied rewrites79.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ x z) y t))) (if (<= z -4.2e-90) t_1 (if (<= z 4.1e-70) (* (/ y (- a z)) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / z), y, t);
double tmp;
if (z <= -4.2e-90) {
tmp = t_1;
} else if (z <= 4.1e-70) {
tmp = (y / (a - z)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / z), y, t) tmp = 0.0 if (z <= -4.2e-90) tmp = t_1; elseif (z <= 4.1e-70) tmp = Float64(Float64(y / Float64(a - z)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * y + t), $MachinePrecision]}, If[LessEqual[z, -4.2e-90], t$95$1, If[LessEqual[z, 4.1e-70], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{z}, y, t\right)\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-70}:\\
\;\;\;\;\frac{y}{a - z} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.1999999999999998e-90 or 4.09999999999999977e-70 < z Initial program 76.3%
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 rewrites70.7%
Applied rewrites70.7%
Taylor expanded in a around 0
Applied rewrites65.5%
Taylor expanded in t around 0
Applied rewrites57.3%
if -4.1999999999999998e-90 < z < 4.09999999999999977e-70Initial program 89.0%
Taylor expanded in t 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--.f6445.8
Applied rewrites45.8%
Taylor expanded in y around inf
Applied rewrites45.2%
Final simplification53.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ x z) y t))) (if (<= z -1.25e-85) t_1 (if (<= z 2.4e-79) (* (/ y a) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / z), y, t);
double tmp;
if (z <= -1.25e-85) {
tmp = t_1;
} else if (z <= 2.4e-79) {
tmp = (y / a) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / z), y, t) tmp = 0.0 if (z <= -1.25e-85) tmp = t_1; elseif (z <= 2.4e-79) tmp = Float64(Float64(y / a) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * y + t), $MachinePrecision]}, If[LessEqual[z, -1.25e-85], t$95$1, If[LessEqual[z, 2.4e-79], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{z}, y, t\right)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-79}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.25e-85 or 2.40000000000000006e-79 < z Initial program 76.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 rewrites70.3%
Applied rewrites70.3%
Taylor expanded in a around 0
Applied rewrites65.1%
Taylor expanded in t around 0
Applied rewrites57.0%
if -1.25e-85 < z < 2.40000000000000006e-79Initial program 88.9%
Taylor expanded in t 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--.f6444.1
Applied rewrites44.1%
Taylor expanded in z around 0
Applied rewrites38.5%
Final simplification50.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (- t x) x))) (if (<= z -3.4e-75) t_1 (if (<= z 2150000000.0) (* (/ 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 <= -3.4e-75) {
tmp = t_1;
} else if (z <= 2150000000.0) {
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 <= (-3.4d-75)) then
tmp = t_1
else if (z <= 2150000000.0d0) 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 <= -3.4e-75) {
tmp = t_1;
} else if (z <= 2150000000.0) {
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 <= -3.4e-75: tmp = t_1 elif z <= 2150000000.0: 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 <= -3.4e-75) tmp = t_1; elseif (z <= 2150000000.0) 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 <= -3.4e-75) tmp = t_1; elseif (z <= 2150000000.0) 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, -3.4e-75], t$95$1, If[LessEqual[z, 2150000000.0], 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 -3.4 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2150000000:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.40000000000000015e-75 or 2.15e9 < z Initial program 72.6%
Taylor expanded in z around inf
lower--.f6436.6
Applied rewrites36.6%
if -3.40000000000000015e-75 < z < 2.15e9Initial program 91.2%
Taylor expanded in t 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--.f6444.6
Applied rewrites44.6%
Taylor expanded in z around 0
Applied rewrites34.7%
Final simplification35.7%
(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 80.7%
Taylor expanded in z around inf
lower--.f6422.9
Applied rewrites22.9%
Final simplification22.9%
(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 80.7%
Taylor expanded in z around inf
lower--.f6422.9
Applied rewrites22.9%
Taylor expanded in t around 0
Applied rewrites2.8%
Final simplification2.8%
herbie shell --seed 2024254
(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)))))