
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* y x))) (t_2 (* z (- x t))))
(if (<= z -2e+77)
t_2
(if (<= z -4.8e-166)
(* (- y z) t)
(if (<= z -1.05e-194)
t_1
(if (<= z 6.5e-238) (+ x (* y t)) (if (<= z 6.1) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (y * x);
double t_2 = z * (x - t);
double tmp;
if (z <= -2e+77) {
tmp = t_2;
} else if (z <= -4.8e-166) {
tmp = (y - z) * t;
} else if (z <= -1.05e-194) {
tmp = t_1;
} else if (z <= 6.5e-238) {
tmp = x + (y * t);
} else if (z <= 6.1) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x - (y * x)
t_2 = z * (x - t)
if (z <= (-2d+77)) then
tmp = t_2
else if (z <= (-4.8d-166)) then
tmp = (y - z) * t
else if (z <= (-1.05d-194)) then
tmp = t_1
else if (z <= 6.5d-238) then
tmp = x + (y * t)
else if (z <= 6.1d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (y * x);
double t_2 = z * (x - t);
double tmp;
if (z <= -2e+77) {
tmp = t_2;
} else if (z <= -4.8e-166) {
tmp = (y - z) * t;
} else if (z <= -1.05e-194) {
tmp = t_1;
} else if (z <= 6.5e-238) {
tmp = x + (y * t);
} else if (z <= 6.1) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (y * x) t_2 = z * (x - t) tmp = 0 if z <= -2e+77: tmp = t_2 elif z <= -4.8e-166: tmp = (y - z) * t elif z <= -1.05e-194: tmp = t_1 elif z <= 6.5e-238: tmp = x + (y * t) elif z <= 6.1: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(y * x)) t_2 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -2e+77) tmp = t_2; elseif (z <= -4.8e-166) tmp = Float64(Float64(y - z) * t); elseif (z <= -1.05e-194) tmp = t_1; elseif (z <= 6.5e-238) tmp = Float64(x + Float64(y * t)); elseif (z <= 6.1) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (y * x); t_2 = z * (x - t); tmp = 0.0; if (z <= -2e+77) tmp = t_2; elseif (z <= -4.8e-166) tmp = (y - z) * t; elseif (z <= -1.05e-194) tmp = t_1; elseif (z <= 6.5e-238) tmp = x + (y * t); elseif (z <= 6.1) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+77], t$95$2, If[LessEqual[z, -4.8e-166], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, -1.05e-194], t$95$1, If[LessEqual[z, 6.5e-238], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.1], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot x\\
t_2 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+77}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-166}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-194}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-238}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;z \leq 6.1:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.99999999999999997e77 or 6.0999999999999996 < z Initial program 100.0%
Taylor expanded in y around 0 84.4%
+-commutative84.4%
mul-1-neg84.4%
unsub-neg84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in z around inf 84.4%
if -1.99999999999999997e77 < z < -4.7999999999999997e-166Initial program 100.0%
Taylor expanded in t around inf 81.8%
Taylor expanded in x around 0 81.8%
*-commutative81.8%
fma-def81.8%
Simplified81.8%
Taylor expanded in t around inf 72.7%
if -4.7999999999999997e-166 < z < -1.05e-194 or 6.5000000000000006e-238 < z < 6.0999999999999996Initial program 100.0%
Taylor expanded in x around inf 71.7%
*-commutative71.7%
mul-1-neg71.7%
unsub-neg71.7%
distribute-lft-out--71.7%
*-rgt-identity71.7%
Simplified71.7%
Taylor expanded in y around inf 69.4%
if -1.05e-194 < z < 6.5000000000000006e-238Initial program 100.0%
Taylor expanded in t around inf 91.8%
Taylor expanded in z around 0 91.8%
Final simplification79.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (+ x (* (- y z) t))))
(if (<= z -8.5e+75)
t_1
(if (<= z 9.5e-225)
t_2
(if (<= z 3e-169) (- x (* y x)) (if (<= z 5.6e+48) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = x + ((y - z) * t);
double tmp;
if (z <= -8.5e+75) {
tmp = t_1;
} else if (z <= 9.5e-225) {
tmp = t_2;
} else if (z <= 3e-169) {
tmp = x - (y * x);
} else if (z <= 5.6e+48) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * (x - t)
t_2 = x + ((y - z) * t)
if (z <= (-8.5d+75)) then
tmp = t_1
else if (z <= 9.5d-225) then
tmp = t_2
else if (z <= 3d-169) then
tmp = x - (y * x)
else if (z <= 5.6d+48) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = x + ((y - z) * t);
double tmp;
if (z <= -8.5e+75) {
tmp = t_1;
} else if (z <= 9.5e-225) {
tmp = t_2;
} else if (z <= 3e-169) {
tmp = x - (y * x);
} else if (z <= 5.6e+48) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = x + ((y - z) * t) tmp = 0 if z <= -8.5e+75: tmp = t_1 elif z <= 9.5e-225: tmp = t_2 elif z <= 3e-169: tmp = x - (y * x) elif z <= 5.6e+48: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) t_2 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (z <= -8.5e+75) tmp = t_1; elseif (z <= 9.5e-225) tmp = t_2; elseif (z <= 3e-169) tmp = Float64(x - Float64(y * x)); elseif (z <= 5.6e+48) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); t_2 = x + ((y - z) * t); tmp = 0.0; if (z <= -8.5e+75) tmp = t_1; elseif (z <= 9.5e-225) tmp = t_2; elseif (z <= 3e-169) tmp = x - (y * x); elseif (z <= 5.6e+48) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+75], t$95$1, If[LessEqual[z, 9.5e-225], t$95$2, If[LessEqual[z, 3e-169], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+48], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+75}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-225}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-169}:\\
\;\;\;\;x - y \cdot x\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+48}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.4999999999999993e75 or 5.60000000000000025e48 < z Initial program 100.0%
Taylor expanded in y around 0 86.7%
+-commutative86.7%
mul-1-neg86.7%
unsub-neg86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in z around inf 86.7%
if -8.4999999999999993e75 < z < 9.50000000000000006e-225 or 2.9999999999999999e-169 < z < 5.60000000000000025e48Initial program 100.0%
Taylor expanded in t around inf 77.5%
if 9.50000000000000006e-225 < z < 2.9999999999999999e-169Initial program 100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
distribute-lft-out--100.0%
*-rgt-identity100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Final simplification82.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- x))) (t_2 (* z (- t))))
(if (<= y -1.05e+37)
t_1
(if (<= y 1.22e-188)
t_2
(if (<= y 1.3e-133)
(* z x)
(if (<= y 1.6e+74) t_2 (if (<= y 2.3e+239) (* y t) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = y * -x;
double t_2 = z * -t;
double tmp;
if (y <= -1.05e+37) {
tmp = t_1;
} else if (y <= 1.22e-188) {
tmp = t_2;
} else if (y <= 1.3e-133) {
tmp = z * x;
} else if (y <= 1.6e+74) {
tmp = t_2;
} else if (y <= 2.3e+239) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * -x
t_2 = z * -t
if (y <= (-1.05d+37)) then
tmp = t_1
else if (y <= 1.22d-188) then
tmp = t_2
else if (y <= 1.3d-133) then
tmp = z * x
else if (y <= 1.6d+74) then
tmp = t_2
else if (y <= 2.3d+239) then
tmp = y * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * -x;
double t_2 = z * -t;
double tmp;
if (y <= -1.05e+37) {
tmp = t_1;
} else if (y <= 1.22e-188) {
tmp = t_2;
} else if (y <= 1.3e-133) {
tmp = z * x;
} else if (y <= 1.6e+74) {
tmp = t_2;
} else if (y <= 2.3e+239) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * -x t_2 = z * -t tmp = 0 if y <= -1.05e+37: tmp = t_1 elif y <= 1.22e-188: tmp = t_2 elif y <= 1.3e-133: tmp = z * x elif y <= 1.6e+74: tmp = t_2 elif y <= 2.3e+239: tmp = y * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(-x)) t_2 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -1.05e+37) tmp = t_1; elseif (y <= 1.22e-188) tmp = t_2; elseif (y <= 1.3e-133) tmp = Float64(z * x); elseif (y <= 1.6e+74) tmp = t_2; elseif (y <= 2.3e+239) tmp = Float64(y * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * -x; t_2 = z * -t; tmp = 0.0; if (y <= -1.05e+37) tmp = t_1; elseif (y <= 1.22e-188) tmp = t_2; elseif (y <= 1.3e-133) tmp = z * x; elseif (y <= 1.6e+74) tmp = t_2; elseif (y <= 2.3e+239) tmp = y * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * (-x)), $MachinePrecision]}, Block[{t$95$2 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -1.05e+37], t$95$1, If[LessEqual[y, 1.22e-188], t$95$2, If[LessEqual[y, 1.3e-133], N[(z * x), $MachinePrecision], If[LessEqual[y, 1.6e+74], t$95$2, If[LessEqual[y, 2.3e+239], N[(y * t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(-x\right)\\
t_2 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{+37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{-188}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-133}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+74}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+239}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.0500000000000001e37 or 2.3000000000000002e239 < y Initial program 100.0%
Taylor expanded in x around inf 66.0%
*-commutative66.0%
mul-1-neg66.0%
unsub-neg66.0%
distribute-lft-out--66.0%
*-rgt-identity66.0%
Simplified66.0%
Taylor expanded in y around inf 54.1%
associate-*r*54.1%
neg-mul-154.1%
Simplified54.1%
if -1.0500000000000001e37 < y < 1.22e-188 or 1.3e-133 < y < 1.59999999999999997e74Initial program 100.0%
Taylor expanded in t around inf 75.3%
Taylor expanded in x around 0 75.3%
*-commutative75.3%
fma-def75.3%
Simplified75.3%
Taylor expanded in z around inf 47.9%
mul-1-neg47.9%
distribute-rgt-neg-out47.9%
Simplified47.9%
if 1.22e-188 < y < 1.3e-133Initial program 99.9%
Taylor expanded in x around inf 78.0%
*-commutative78.0%
mul-1-neg78.0%
unsub-neg78.0%
distribute-lft-out--78.0%
*-rgt-identity78.0%
Simplified78.0%
Taylor expanded in z around inf 52.6%
if 1.59999999999999997e74 < y < 2.3000000000000002e239Initial program 100.0%
Taylor expanded in t around inf 68.3%
Taylor expanded in x around 0 68.3%
*-commutative68.3%
fma-def68.3%
Simplified68.3%
Taylor expanded in y around inf 60.4%
Final simplification51.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (* (- y z) t)))
(if (<= z -3.8e+75)
t_1
(if (<= z 8e-221)
t_2
(if (<= z 1.45e-155) x (if (<= z 4.5e+51) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = (y - z) * t;
double tmp;
if (z <= -3.8e+75) {
tmp = t_1;
} else if (z <= 8e-221) {
tmp = t_2;
} else if (z <= 1.45e-155) {
tmp = x;
} else if (z <= 4.5e+51) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * (x - t)
t_2 = (y - z) * t
if (z <= (-3.8d+75)) then
tmp = t_1
else if (z <= 8d-221) then
tmp = t_2
else if (z <= 1.45d-155) then
tmp = x
else if (z <= 4.5d+51) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = (y - z) * t;
double tmp;
if (z <= -3.8e+75) {
tmp = t_1;
} else if (z <= 8e-221) {
tmp = t_2;
} else if (z <= 1.45e-155) {
tmp = x;
} else if (z <= 4.5e+51) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = (y - z) * t tmp = 0 if z <= -3.8e+75: tmp = t_1 elif z <= 8e-221: tmp = t_2 elif z <= 1.45e-155: tmp = x elif z <= 4.5e+51: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) t_2 = Float64(Float64(y - z) * t) tmp = 0.0 if (z <= -3.8e+75) tmp = t_1; elseif (z <= 8e-221) tmp = t_2; elseif (z <= 1.45e-155) tmp = x; elseif (z <= 4.5e+51) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); t_2 = (y - z) * t; tmp = 0.0; if (z <= -3.8e+75) tmp = t_1; elseif (z <= 8e-221) tmp = t_2; elseif (z <= 1.45e-155) tmp = x; elseif (z <= 4.5e+51) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[z, -3.8e+75], t$95$1, If[LessEqual[z, 8e-221], t$95$2, If[LessEqual[z, 1.45e-155], x, If[LessEqual[z, 4.5e+51], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+75}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-221}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-155}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+51}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.8000000000000002e75 or 4.5e51 < z Initial program 100.0%
Taylor expanded in y around 0 86.7%
+-commutative86.7%
mul-1-neg86.7%
unsub-neg86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in z around inf 86.7%
if -3.8000000000000002e75 < z < 8.00000000000000014e-221 or 1.45000000000000005e-155 < z < 4.5e51Initial program 100.0%
Taylor expanded in t around inf 77.1%
Taylor expanded in x around 0 77.1%
*-commutative77.1%
fma-def77.1%
Simplified77.1%
Taylor expanded in t around inf 60.2%
if 8.00000000000000014e-221 < z < 1.45000000000000005e-155Initial program 100.0%
Taylor expanded in t around inf 62.7%
Taylor expanded in x around inf 54.7%
Final simplification72.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -3e+76)
t_1
(if (<= z -8e-86)
(+ x (* (- y z) t))
(if (<= z 6.5) (+ x (* y (- t x))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -3e+76) {
tmp = t_1;
} else if (z <= -8e-86) {
tmp = x + ((y - z) * t);
} else if (z <= 6.5) {
tmp = x + (y * (t - x));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * (x - t)
if (z <= (-3d+76)) then
tmp = t_1
else if (z <= (-8d-86)) then
tmp = x + ((y - z) * t)
else if (z <= 6.5d0) then
tmp = x + (y * (t - x))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -3e+76) {
tmp = t_1;
} else if (z <= -8e-86) {
tmp = x + ((y - z) * t);
} else if (z <= 6.5) {
tmp = x + (y * (t - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -3e+76: tmp = t_1 elif z <= -8e-86: tmp = x + ((y - z) * t) elif z <= 6.5: tmp = x + (y * (t - x)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -3e+76) tmp = t_1; elseif (z <= -8e-86) tmp = Float64(x + Float64(Float64(y - z) * t)); elseif (z <= 6.5) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -3e+76) tmp = t_1; elseif (z <= -8e-86) tmp = x + ((y - z) * t); elseif (z <= 6.5) tmp = x + (y * (t - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e+76], t$95$1, If[LessEqual[z, -8e-86], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -3 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-86}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{elif}\;z \leq 6.5:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.9999999999999998e76 or 6.5 < z Initial program 100.0%
Taylor expanded in y around 0 84.4%
+-commutative84.4%
mul-1-neg84.4%
unsub-neg84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in z around inf 84.4%
if -2.9999999999999998e76 < z < -8.00000000000000068e-86Initial program 100.0%
Taylor expanded in t around inf 81.6%
if -8.00000000000000068e-86 < z < 6.5Initial program 100.0%
Taylor expanded in z around 0 90.1%
Final simplification86.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= y -9.5e-23)
(* y t)
(if (<= y 1.3e-188)
t_1
(if (<= y 9e-134) (* z x) (if (<= y 6.8e+74) t_1 (* y t)))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -9.5e-23) {
tmp = y * t;
} else if (y <= 1.3e-188) {
tmp = t_1;
} else if (y <= 9e-134) {
tmp = z * x;
} else if (y <= 6.8e+74) {
tmp = t_1;
} else {
tmp = y * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * -t
if (y <= (-9.5d-23)) then
tmp = y * t
else if (y <= 1.3d-188) then
tmp = t_1
else if (y <= 9d-134) then
tmp = z * x
else if (y <= 6.8d+74) then
tmp = t_1
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -9.5e-23) {
tmp = y * t;
} else if (y <= 1.3e-188) {
tmp = t_1;
} else if (y <= 9e-134) {
tmp = z * x;
} else if (y <= 6.8e+74) {
tmp = t_1;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if y <= -9.5e-23: tmp = y * t elif y <= 1.3e-188: tmp = t_1 elif y <= 9e-134: tmp = z * x elif y <= 6.8e+74: tmp = t_1 else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -9.5e-23) tmp = Float64(y * t); elseif (y <= 1.3e-188) tmp = t_1; elseif (y <= 9e-134) tmp = Float64(z * x); elseif (y <= 6.8e+74) tmp = t_1; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (y <= -9.5e-23) tmp = y * t; elseif (y <= 1.3e-188) tmp = t_1; elseif (y <= 9e-134) tmp = z * x; elseif (y <= 6.8e+74) tmp = t_1; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -9.5e-23], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.3e-188], t$95$1, If[LessEqual[y, 9e-134], N[(z * x), $MachinePrecision], If[LessEqual[y, 6.8e+74], t$95$1, N[(y * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{-23}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-188}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-134}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+74}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -9.50000000000000058e-23 or 6.7999999999999998e74 < y Initial program 100.0%
Taylor expanded in t around inf 55.6%
Taylor expanded in x around 0 55.6%
*-commutative55.6%
fma-def55.6%
Simplified55.6%
Taylor expanded in y around inf 45.2%
if -9.50000000000000058e-23 < y < 1.3e-188 or 9.000000000000001e-134 < y < 6.7999999999999998e74Initial program 100.0%
Taylor expanded in t around inf 76.0%
Taylor expanded in x around 0 76.0%
*-commutative76.0%
fma-def76.0%
Simplified76.0%
Taylor expanded in z around inf 50.6%
mul-1-neg50.6%
distribute-rgt-neg-out50.6%
Simplified50.6%
if 1.3e-188 < y < 9.000000000000001e-134Initial program 99.9%
Taylor expanded in x around inf 78.0%
*-commutative78.0%
mul-1-neg78.0%
unsub-neg78.0%
distribute-lft-out--78.0%
*-rgt-identity78.0%
Simplified78.0%
Taylor expanded in z around inf 52.6%
Final simplification48.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -9e+76)
(* z x)
(if (<= z 7.5e-229)
(* y t)
(if (<= z 3e-159) x (if (<= z 1e+51) (* y t) (* z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9e+76) {
tmp = z * x;
} else if (z <= 7.5e-229) {
tmp = y * t;
} else if (z <= 3e-159) {
tmp = x;
} else if (z <= 1e+51) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-9d+76)) then
tmp = z * x
else if (z <= 7.5d-229) then
tmp = y * t
else if (z <= 3d-159) then
tmp = x
else if (z <= 1d+51) then
tmp = y * t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9e+76) {
tmp = z * x;
} else if (z <= 7.5e-229) {
tmp = y * t;
} else if (z <= 3e-159) {
tmp = x;
} else if (z <= 1e+51) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -9e+76: tmp = z * x elif z <= 7.5e-229: tmp = y * t elif z <= 3e-159: tmp = x elif z <= 1e+51: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -9e+76) tmp = Float64(z * x); elseif (z <= 7.5e-229) tmp = Float64(y * t); elseif (z <= 3e-159) tmp = x; elseif (z <= 1e+51) tmp = Float64(y * t); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -9e+76) tmp = z * x; elseif (z <= 7.5e-229) tmp = y * t; elseif (z <= 3e-159) tmp = x; elseif (z <= 1e+51) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -9e+76], N[(z * x), $MachinePrecision], If[LessEqual[z, 7.5e-229], N[(y * t), $MachinePrecision], If[LessEqual[z, 3e-159], x, If[LessEqual[z, 1e+51], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+76}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-229}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-159}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 10^{+51}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -8.9999999999999995e76 or 1e51 < z Initial program 100.0%
Taylor expanded in x around inf 55.1%
*-commutative55.1%
mul-1-neg55.1%
unsub-neg55.1%
distribute-lft-out--55.1%
*-rgt-identity55.1%
Simplified55.1%
Taylor expanded in z around inf 45.2%
if -8.9999999999999995e76 < z < 7.4999999999999999e-229 or 3.00000000000000009e-159 < z < 1e51Initial program 100.0%
Taylor expanded in t around inf 76.9%
Taylor expanded in x around 0 76.9%
*-commutative76.9%
fma-def76.9%
Simplified76.9%
Taylor expanded in y around inf 41.8%
if 7.4999999999999999e-229 < z < 3.00000000000000009e-159Initial program 100.0%
Taylor expanded in t around inf 65.5%
Taylor expanded in x around inf 51.0%
Final simplification43.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)))
(if (<= t -2.25e-156)
t_1
(if (<= t -7.8e-249) (* y (- x)) (if (<= t 1.02e-111) (* z x) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -2.25e-156) {
tmp = t_1;
} else if (t <= -7.8e-249) {
tmp = y * -x;
} else if (t <= 1.02e-111) {
tmp = z * x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * t
if (t <= (-2.25d-156)) then
tmp = t_1
else if (t <= (-7.8d-249)) then
tmp = y * -x
else if (t <= 1.02d-111) then
tmp = z * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -2.25e-156) {
tmp = t_1;
} else if (t <= -7.8e-249) {
tmp = y * -x;
} else if (t <= 1.02e-111) {
tmp = z * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -2.25e-156: tmp = t_1 elif t <= -7.8e-249: tmp = y * -x elif t <= 1.02e-111: tmp = z * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (t <= -2.25e-156) tmp = t_1; elseif (t <= -7.8e-249) tmp = Float64(y * Float64(-x)); elseif (t <= 1.02e-111) tmp = Float64(z * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; tmp = 0.0; if (t <= -2.25e-156) tmp = t_1; elseif (t <= -7.8e-249) tmp = y * -x; elseif (t <= 1.02e-111) tmp = z * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.25e-156], t$95$1, If[LessEqual[t, -7.8e-249], N[(y * (-x)), $MachinePrecision], If[LessEqual[t, 1.02e-111], N[(z * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -2.25 \cdot 10^{-156}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7.8 \cdot 10^{-249}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{-111}:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.24999999999999993e-156 or 1.02000000000000003e-111 < t Initial program 100.0%
Taylor expanded in t around inf 79.9%
Taylor expanded in x around 0 79.9%
*-commutative79.9%
fma-def80.0%
Simplified80.0%
Taylor expanded in t around inf 69.9%
if -2.24999999999999993e-156 < t < -7.7999999999999998e-249Initial program 100.0%
Taylor expanded in x around inf 94.3%
*-commutative94.3%
mul-1-neg94.3%
unsub-neg94.3%
distribute-lft-out--94.4%
*-rgt-identity94.4%
Simplified94.4%
Taylor expanded in y around inf 66.2%
associate-*r*66.2%
neg-mul-166.2%
Simplified66.2%
if -7.7999999999999998e-249 < t < 1.02000000000000003e-111Initial program 100.0%
Taylor expanded in x around inf 93.6%
*-commutative93.6%
mul-1-neg93.6%
unsub-neg93.6%
distribute-lft-out--93.7%
*-rgt-identity93.7%
Simplified93.7%
Taylor expanded in z around inf 48.7%
Final simplification65.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.2e+65) (not (<= y 5.5e+76))) (+ x (* y (- t x))) (+ x (* z (- x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.2e+65) || !(y <= 5.5e+76)) {
tmp = x + (y * (t - x));
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-3.2d+65)) .or. (.not. (y <= 5.5d+76))) then
tmp = x + (y * (t - x))
else
tmp = x + (z * (x - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.2e+65) || !(y <= 5.5e+76)) {
tmp = x + (y * (t - x));
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.2e+65) or not (y <= 5.5e+76): tmp = x + (y * (t - x)) else: tmp = x + (z * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.2e+65) || !(y <= 5.5e+76)) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = Float64(x + Float64(z * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.2e+65) || ~((y <= 5.5e+76))) tmp = x + (y * (t - x)); else tmp = x + (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.2e+65], N[Not[LessEqual[y, 5.5e+76]], $MachinePrecision]], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+65} \lor \neg \left(y \leq 5.5 \cdot 10^{+76}\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -3.20000000000000007e65 or 5.5000000000000001e76 < y Initial program 100.0%
Taylor expanded in z around 0 85.5%
if -3.20000000000000007e65 < y < 5.5000000000000001e76Initial program 99.9%
Taylor expanded in y around 0 87.9%
+-commutative87.9%
mul-1-neg87.9%
unsub-neg87.9%
*-commutative87.9%
Simplified87.9%
Final simplification86.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.45e-16) (not (<= z 0.455))) (* z (- x t)) (+ x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.45e-16) || !(z <= 0.455)) {
tmp = z * (x - t);
} else {
tmp = x + (y * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.45d-16)) .or. (.not. (z <= 0.455d0))) then
tmp = z * (x - t)
else
tmp = x + (y * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.45e-16) || !(z <= 0.455)) {
tmp = z * (x - t);
} else {
tmp = x + (y * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.45e-16) or not (z <= 0.455): tmp = z * (x - t) else: tmp = x + (y * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.45e-16) || !(z <= 0.455)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x + Float64(y * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.45e-16) || ~((z <= 0.455))) tmp = z * (x - t); else tmp = x + (y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.45e-16], N[Not[LessEqual[z, 0.455]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-16} \lor \neg \left(z \leq 0.455\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot t\\
\end{array}
\end{array}
if z < -1.4499999999999999e-16 or 0.455000000000000016 < z Initial program 100.0%
Taylor expanded in y around 0 83.3%
+-commutative83.3%
mul-1-neg83.3%
unsub-neg83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in z around inf 82.0%
if -1.4499999999999999e-16 < z < 0.455000000000000016Initial program 100.0%
Taylor expanded in t around inf 76.9%
Taylor expanded in z around 0 66.3%
Final simplification75.3%
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (<= y -3.4e-16) (* y t) (if (<= y 1.45e-5) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.4e-16) {
tmp = y * t;
} else if (y <= 1.45e-5) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.4d-16)) then
tmp = y * t
else if (y <= 1.45d-5) then
tmp = x
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.4e-16) {
tmp = y * t;
} else if (y <= 1.45e-5) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.4e-16: tmp = y * t elif y <= 1.45e-5: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.4e-16) tmp = Float64(y * t); elseif (y <= 1.45e-5) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.4e-16) tmp = y * t; elseif (y <= 1.45e-5) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.4e-16], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.45e-5], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-16}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -3.4e-16 or 1.45e-5 < y Initial program 100.0%
Taylor expanded in t around inf 55.9%
Taylor expanded in x around 0 55.9%
*-commutative55.9%
fma-def55.9%
Simplified55.9%
Taylor expanded in y around inf 42.7%
if -3.4e-16 < y < 1.45e-5Initial program 100.0%
Taylor expanded in t around inf 75.8%
Taylor expanded in x around inf 25.1%
Final simplification34.3%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 100.0%
Taylor expanded in t around inf 65.4%
Taylor expanded in x around inf 13.2%
Final simplification13.2%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2023221
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:herbie-target
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))