
(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-define100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= y -2.2e+52)
(* y t)
(if (<= y -7.5e-94)
t_1
(if (<= y -3.8e-215)
x
(if (<= y -5.5e-245)
t_1
(if (<= y 1.75e-208)
x
(if (<= y 5.6e-98)
t_1
(if (<= y 0.00014)
x
(if (<= y 8.2e+214) (* y t) (* y (- x))))))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -2.2e+52) {
tmp = y * t;
} else if (y <= -7.5e-94) {
tmp = t_1;
} else if (y <= -3.8e-215) {
tmp = x;
} else if (y <= -5.5e-245) {
tmp = t_1;
} else if (y <= 1.75e-208) {
tmp = x;
} else if (y <= 5.6e-98) {
tmp = t_1;
} else if (y <= 0.00014) {
tmp = x;
} else if (y <= 8.2e+214) {
tmp = y * t;
} else {
tmp = y * -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) :: t_1
real(8) :: tmp
t_1 = z * -t
if (y <= (-2.2d+52)) then
tmp = y * t
else if (y <= (-7.5d-94)) then
tmp = t_1
else if (y <= (-3.8d-215)) then
tmp = x
else if (y <= (-5.5d-245)) then
tmp = t_1
else if (y <= 1.75d-208) then
tmp = x
else if (y <= 5.6d-98) then
tmp = t_1
else if (y <= 0.00014d0) then
tmp = x
else if (y <= 8.2d+214) then
tmp = y * t
else
tmp = y * -x
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 <= -2.2e+52) {
tmp = y * t;
} else if (y <= -7.5e-94) {
tmp = t_1;
} else if (y <= -3.8e-215) {
tmp = x;
} else if (y <= -5.5e-245) {
tmp = t_1;
} else if (y <= 1.75e-208) {
tmp = x;
} else if (y <= 5.6e-98) {
tmp = t_1;
} else if (y <= 0.00014) {
tmp = x;
} else if (y <= 8.2e+214) {
tmp = y * t;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if y <= -2.2e+52: tmp = y * t elif y <= -7.5e-94: tmp = t_1 elif y <= -3.8e-215: tmp = x elif y <= -5.5e-245: tmp = t_1 elif y <= 1.75e-208: tmp = x elif y <= 5.6e-98: tmp = t_1 elif y <= 0.00014: tmp = x elif y <= 8.2e+214: tmp = y * t else: tmp = y * -x return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -2.2e+52) tmp = Float64(y * t); elseif (y <= -7.5e-94) tmp = t_1; elseif (y <= -3.8e-215) tmp = x; elseif (y <= -5.5e-245) tmp = t_1; elseif (y <= 1.75e-208) tmp = x; elseif (y <= 5.6e-98) tmp = t_1; elseif (y <= 0.00014) tmp = x; elseif (y <= 8.2e+214) tmp = Float64(y * t); else tmp = Float64(y * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (y <= -2.2e+52) tmp = y * t; elseif (y <= -7.5e-94) tmp = t_1; elseif (y <= -3.8e-215) tmp = x; elseif (y <= -5.5e-245) tmp = t_1; elseif (y <= 1.75e-208) tmp = x; elseif (y <= 5.6e-98) tmp = t_1; elseif (y <= 0.00014) tmp = x; elseif (y <= 8.2e+214) tmp = y * t; else tmp = y * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -2.2e+52], N[(y * t), $MachinePrecision], If[LessEqual[y, -7.5e-94], t$95$1, If[LessEqual[y, -3.8e-215], x, If[LessEqual[y, -5.5e-245], t$95$1, If[LessEqual[y, 1.75e-208], x, If[LessEqual[y, 5.6e-98], t$95$1, If[LessEqual[y, 0.00014], x, If[LessEqual[y, 8.2e+214], N[(y * t), $MachinePrecision], N[(y * (-x)), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+52}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-215}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{-245}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-208}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.00014:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+214}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if y < -2.2e52 or 1.3999999999999999e-4 < y < 8.2e214Initial program 99.9%
Taylor expanded in y around inf 74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in y around inf 74.9%
Taylor expanded in t around inf 46.5%
*-commutative46.5%
Simplified46.5%
if -2.2e52 < y < -7.5000000000000003e-94 or -3.79999999999999977e-215 < y < -5.49999999999999962e-245 or 1.74999999999999996e-208 < y < 5.5999999999999998e-98Initial program 100.0%
Taylor expanded in t around inf 71.1%
Taylor expanded in y around 0 64.4%
mul-1-neg64.4%
*-commutative64.4%
distribute-rgt-neg-in64.4%
Simplified64.4%
Taylor expanded in x around 0 52.8%
associate-*r*52.8%
mul-1-neg52.8%
Simplified52.8%
if -7.5000000000000003e-94 < y < -3.79999999999999977e-215 or -5.49999999999999962e-245 < y < 1.74999999999999996e-208 or 5.5999999999999998e-98 < y < 1.3999999999999999e-4Initial program 100.0%
Taylor expanded in t around inf 83.0%
Taylor expanded in x around inf 57.2%
if 8.2e214 < y Initial program 100.0%
Taylor expanded in x around inf 74.1%
mul-1-neg74.1%
unsub-neg74.1%
Simplified74.1%
Taylor expanded in y around inf 74.1%
mul-1-neg74.1%
distribute-lft-neg-out74.1%
*-commutative74.1%
Simplified74.1%
Final simplification53.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (* z (- t))) (t_3 (* x (- 1.0 y))))
(if (<= z -4.5e+168)
t_2
(if (<= z -1.15e+91)
(* z x)
(if (<= z -2.8e-165)
t_1
(if (<= z -1.7e-186)
t_3
(if (<= z -6.6e-267)
t_1
(if (<= z 1.12e-14) t_3 (if (<= z 2.3e+182) t_1 t_2)))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = z * -t;
double t_3 = x * (1.0 - y);
double tmp;
if (z <= -4.5e+168) {
tmp = t_2;
} else if (z <= -1.15e+91) {
tmp = z * x;
} else if (z <= -2.8e-165) {
tmp = t_1;
} else if (z <= -1.7e-186) {
tmp = t_3;
} else if (z <= -6.6e-267) {
tmp = t_1;
} else if (z <= 1.12e-14) {
tmp = t_3;
} else if (z <= 2.3e+182) {
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) :: t_3
real(8) :: tmp
t_1 = y * (t - x)
t_2 = z * -t
t_3 = x * (1.0d0 - y)
if (z <= (-4.5d+168)) then
tmp = t_2
else if (z <= (-1.15d+91)) then
tmp = z * x
else if (z <= (-2.8d-165)) then
tmp = t_1
else if (z <= (-1.7d-186)) then
tmp = t_3
else if (z <= (-6.6d-267)) then
tmp = t_1
else if (z <= 1.12d-14) then
tmp = t_3
else if (z <= 2.3d+182) 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 = y * (t - x);
double t_2 = z * -t;
double t_3 = x * (1.0 - y);
double tmp;
if (z <= -4.5e+168) {
tmp = t_2;
} else if (z <= -1.15e+91) {
tmp = z * x;
} else if (z <= -2.8e-165) {
tmp = t_1;
} else if (z <= -1.7e-186) {
tmp = t_3;
} else if (z <= -6.6e-267) {
tmp = t_1;
} else if (z <= 1.12e-14) {
tmp = t_3;
} else if (z <= 2.3e+182) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = z * -t t_3 = x * (1.0 - y) tmp = 0 if z <= -4.5e+168: tmp = t_2 elif z <= -1.15e+91: tmp = z * x elif z <= -2.8e-165: tmp = t_1 elif z <= -1.7e-186: tmp = t_3 elif z <= -6.6e-267: tmp = t_1 elif z <= 1.12e-14: tmp = t_3 elif z <= 2.3e+182: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(z * Float64(-t)) t_3 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (z <= -4.5e+168) tmp = t_2; elseif (z <= -1.15e+91) tmp = Float64(z * x); elseif (z <= -2.8e-165) tmp = t_1; elseif (z <= -1.7e-186) tmp = t_3; elseif (z <= -6.6e-267) tmp = t_1; elseif (z <= 1.12e-14) tmp = t_3; elseif (z <= 2.3e+182) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = z * -t; t_3 = x * (1.0 - y); tmp = 0.0; if (z <= -4.5e+168) tmp = t_2; elseif (z <= -1.15e+91) tmp = z * x; elseif (z <= -2.8e-165) tmp = t_1; elseif (z <= -1.7e-186) tmp = t_3; elseif (z <= -6.6e-267) tmp = t_1; elseif (z <= 1.12e-14) tmp = t_3; elseif (z <= 2.3e+182) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+168], t$95$2, If[LessEqual[z, -1.15e+91], N[(z * x), $MachinePrecision], If[LessEqual[z, -2.8e-165], t$95$1, If[LessEqual[z, -1.7e-186], t$95$3, If[LessEqual[z, -6.6e-267], t$95$1, If[LessEqual[z, 1.12e-14], t$95$3, If[LessEqual[z, 2.3e+182], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := z \cdot \left(-t\right)\\
t_3 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+168}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{+91}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-165}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-186}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-267}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-14}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+182}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.50000000000000012e168 or 2.3e182 < z Initial program 100.0%
Taylor expanded in t around inf 66.9%
Taylor expanded in y around 0 64.0%
mul-1-neg64.0%
*-commutative64.0%
distribute-rgt-neg-in64.0%
Simplified64.0%
Taylor expanded in x around 0 63.8%
associate-*r*63.8%
mul-1-neg63.8%
Simplified63.8%
if -4.50000000000000012e168 < z < -1.14999999999999996e91Initial program 100.0%
Taylor expanded in x around inf 73.8%
mul-1-neg73.8%
unsub-neg73.8%
Simplified73.8%
Taylor expanded in z around inf 68.3%
if -1.14999999999999996e91 < z < -2.7999999999999999e-165 or -1.7e-186 < z < -6.60000000000000007e-267 or 1.12000000000000006e-14 < z < 2.3e182Initial program 100.0%
Taylor expanded in y around inf 77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in y around inf 74.7%
Taylor expanded in y around inf 64.9%
if -2.7999999999999999e-165 < z < -1.7e-186 or -6.60000000000000007e-267 < z < 1.12000000000000006e-14Initial program 99.9%
Taylor expanded in x around inf 76.0%
mul-1-neg76.0%
unsub-neg76.0%
Simplified76.0%
Taylor expanded in z around 0 76.0%
Final simplification68.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))) (t_2 (* x (- 1.0 y))))
(if (<= z -3.4e+168)
t_1
(if (<= z -4.2e+89)
(* z x)
(if (<= z -8.8e-13)
(* y t)
(if (<= z -1.02e-115)
t_2
(if (<= z -7.8e-162) (* y t) (if (<= z 6.8e+106) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = x * (1.0 - y);
double tmp;
if (z <= -3.4e+168) {
tmp = t_1;
} else if (z <= -4.2e+89) {
tmp = z * x;
} else if (z <= -8.8e-13) {
tmp = y * t;
} else if (z <= -1.02e-115) {
tmp = t_2;
} else if (z <= -7.8e-162) {
tmp = y * t;
} else if (z <= 6.8e+106) {
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 * -t
t_2 = x * (1.0d0 - y)
if (z <= (-3.4d+168)) then
tmp = t_1
else if (z <= (-4.2d+89)) then
tmp = z * x
else if (z <= (-8.8d-13)) then
tmp = y * t
else if (z <= (-1.02d-115)) then
tmp = t_2
else if (z <= (-7.8d-162)) then
tmp = y * t
else if (z <= 6.8d+106) 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 * -t;
double t_2 = x * (1.0 - y);
double tmp;
if (z <= -3.4e+168) {
tmp = t_1;
} else if (z <= -4.2e+89) {
tmp = z * x;
} else if (z <= -8.8e-13) {
tmp = y * t;
} else if (z <= -1.02e-115) {
tmp = t_2;
} else if (z <= -7.8e-162) {
tmp = y * t;
} else if (z <= 6.8e+106) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t t_2 = x * (1.0 - y) tmp = 0 if z <= -3.4e+168: tmp = t_1 elif z <= -4.2e+89: tmp = z * x elif z <= -8.8e-13: tmp = y * t elif z <= -1.02e-115: tmp = t_2 elif z <= -7.8e-162: tmp = y * t elif z <= 6.8e+106: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) t_2 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (z <= -3.4e+168) tmp = t_1; elseif (z <= -4.2e+89) tmp = Float64(z * x); elseif (z <= -8.8e-13) tmp = Float64(y * t); elseif (z <= -1.02e-115) tmp = t_2; elseif (z <= -7.8e-162) tmp = Float64(y * t); elseif (z <= 6.8e+106) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; t_2 = x * (1.0 - y); tmp = 0.0; if (z <= -3.4e+168) tmp = t_1; elseif (z <= -4.2e+89) tmp = z * x; elseif (z <= -8.8e-13) tmp = y * t; elseif (z <= -1.02e-115) tmp = t_2; elseif (z <= -7.8e-162) tmp = y * t; elseif (z <= 6.8e+106) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e+168], t$95$1, If[LessEqual[z, -4.2e+89], N[(z * x), $MachinePrecision], If[LessEqual[z, -8.8e-13], N[(y * t), $MachinePrecision], If[LessEqual[z, -1.02e-115], t$95$2, If[LessEqual[z, -7.8e-162], N[(y * t), $MachinePrecision], If[LessEqual[z, 6.8e+106], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
t_2 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{+168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{+89}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{-13}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-115}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-162}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+106}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.40000000000000003e168 or 6.79999999999999989e106 < z Initial program 100.0%
Taylor expanded in t around inf 66.1%
Taylor expanded in y around 0 59.6%
mul-1-neg59.6%
*-commutative59.6%
distribute-rgt-neg-in59.6%
Simplified59.6%
Taylor expanded in x around 0 59.4%
associate-*r*59.4%
mul-1-neg59.4%
Simplified59.4%
if -3.40000000000000003e168 < z < -4.19999999999999972e89Initial program 100.0%
Taylor expanded in x around inf 73.8%
mul-1-neg73.8%
unsub-neg73.8%
Simplified73.8%
Taylor expanded in z around inf 68.3%
if -4.19999999999999972e89 < z < -8.79999999999999986e-13 or -1.02e-115 < z < -7.7999999999999999e-162Initial program 99.9%
Taylor expanded in y around inf 73.6%
*-commutative73.6%
Simplified73.6%
Taylor expanded in y around inf 73.6%
Taylor expanded in t around inf 60.1%
*-commutative60.1%
Simplified60.1%
if -8.79999999999999986e-13 < z < -1.02e-115 or -7.7999999999999999e-162 < z < 6.79999999999999989e106Initial program 100.0%
Taylor expanded in x around inf 67.5%
mul-1-neg67.5%
unsub-neg67.5%
Simplified67.5%
Taylor expanded in z around 0 65.5%
Final simplification63.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -1500.0)
(* y t)
(if (<= y 6e-200)
x
(if (<= y 2.3e-175)
(* z x)
(if (<= y 4.6e-6) x (if (<= y 1.08e+214) (* y t) (* y (- x))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1500.0) {
tmp = y * t;
} else if (y <= 6e-200) {
tmp = x;
} else if (y <= 2.3e-175) {
tmp = z * x;
} else if (y <= 4.6e-6) {
tmp = x;
} else if (y <= 1.08e+214) {
tmp = y * t;
} else {
tmp = y * -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 (y <= (-1500.0d0)) then
tmp = y * t
else if (y <= 6d-200) then
tmp = x
else if (y <= 2.3d-175) then
tmp = z * x
else if (y <= 4.6d-6) then
tmp = x
else if (y <= 1.08d+214) then
tmp = y * t
else
tmp = y * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1500.0) {
tmp = y * t;
} else if (y <= 6e-200) {
tmp = x;
} else if (y <= 2.3e-175) {
tmp = z * x;
} else if (y <= 4.6e-6) {
tmp = x;
} else if (y <= 1.08e+214) {
tmp = y * t;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1500.0: tmp = y * t elif y <= 6e-200: tmp = x elif y <= 2.3e-175: tmp = z * x elif y <= 4.6e-6: tmp = x elif y <= 1.08e+214: tmp = y * t else: tmp = y * -x return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1500.0) tmp = Float64(y * t); elseif (y <= 6e-200) tmp = x; elseif (y <= 2.3e-175) tmp = Float64(z * x); elseif (y <= 4.6e-6) tmp = x; elseif (y <= 1.08e+214) tmp = Float64(y * t); else tmp = Float64(y * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1500.0) tmp = y * t; elseif (y <= 6e-200) tmp = x; elseif (y <= 2.3e-175) tmp = z * x; elseif (y <= 4.6e-6) tmp = x; elseif (y <= 1.08e+214) tmp = y * t; else tmp = y * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1500.0], N[(y * t), $MachinePrecision], If[LessEqual[y, 6e-200], x, If[LessEqual[y, 2.3e-175], N[(z * x), $MachinePrecision], If[LessEqual[y, 4.6e-6], x, If[LessEqual[y, 1.08e+214], N[(y * t), $MachinePrecision], N[(y * (-x)), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1500:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-200}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-175}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.08 \cdot 10^{+214}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if y < -1500 or 4.6e-6 < y < 1.08e214Initial program 99.9%
Taylor expanded in y around inf 73.7%
*-commutative73.7%
Simplified73.7%
Taylor expanded in y around inf 73.7%
Taylor expanded in t around inf 45.2%
*-commutative45.2%
Simplified45.2%
if -1500 < y < 5.99999999999999989e-200 or 2.3e-175 < y < 4.6e-6Initial program 100.0%
Taylor expanded in t around inf 81.0%
Taylor expanded in x around inf 42.9%
if 5.99999999999999989e-200 < y < 2.3e-175Initial program 100.0%
Taylor expanded in x around inf 63.5%
mul-1-neg63.5%
unsub-neg63.5%
Simplified63.5%
Taylor expanded in z around inf 63.5%
if 1.08e214 < y Initial program 100.0%
Taylor expanded in x around inf 74.1%
mul-1-neg74.1%
unsub-neg74.1%
Simplified74.1%
Taylor expanded in y around inf 74.1%
mul-1-neg74.1%
distribute-lft-neg-out74.1%
*-commutative74.1%
Simplified74.1%
Final simplification47.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (+ x (* z x))))
(if (<= y -0.085)
t_1
(if (<= y 8.5e-137)
t_2
(if (<= y 5.8e-98) (* z (- t)) (if (<= y 0.000115) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x + (z * x);
double tmp;
if (y <= -0.085) {
tmp = t_1;
} else if (y <= 8.5e-137) {
tmp = t_2;
} else if (y <= 5.8e-98) {
tmp = z * -t;
} else if (y <= 0.000115) {
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 = y * (t - x)
t_2 = x + (z * x)
if (y <= (-0.085d0)) then
tmp = t_1
else if (y <= 8.5d-137) then
tmp = t_2
else if (y <= 5.8d-98) then
tmp = z * -t
else if (y <= 0.000115d0) 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 = y * (t - x);
double t_2 = x + (z * x);
double tmp;
if (y <= -0.085) {
tmp = t_1;
} else if (y <= 8.5e-137) {
tmp = t_2;
} else if (y <= 5.8e-98) {
tmp = z * -t;
} else if (y <= 0.000115) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x + (z * x) tmp = 0 if y <= -0.085: tmp = t_1 elif y <= 8.5e-137: tmp = t_2 elif y <= 5.8e-98: tmp = z * -t elif y <= 0.000115: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(x + Float64(z * x)) tmp = 0.0 if (y <= -0.085) tmp = t_1; elseif (y <= 8.5e-137) tmp = t_2; elseif (y <= 5.8e-98) tmp = Float64(z * Float64(-t)); elseif (y <= 0.000115) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = x + (z * x); tmp = 0.0; if (y <= -0.085) tmp = t_1; elseif (y <= 8.5e-137) tmp = t_2; elseif (y <= 5.8e-98) tmp = z * -t; elseif (y <= 0.000115) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.085], t$95$1, If[LessEqual[y, 8.5e-137], t$95$2, If[LessEqual[y, 5.8e-98], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 0.000115], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x + z \cdot x\\
\mathbf{if}\;y \leq -0.085:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-137}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-98}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 0.000115:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -0.0850000000000000061 or 1.15e-4 < y Initial program 99.9%
Taylor expanded in y around inf 78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in y around inf 78.3%
Taylor expanded in y around inf 77.4%
if -0.0850000000000000061 < y < 8.5000000000000001e-137 or 5.8e-98 < y < 1.15e-4Initial program 100.0%
Taylor expanded in t around 0 66.3%
mul-1-neg66.3%
distribute-rgt-neg-in66.3%
neg-sub066.3%
sub-neg66.3%
+-commutative66.3%
associate--r+66.3%
neg-sub066.3%
remove-double-neg66.3%
Simplified66.3%
Taylor expanded in y around 0 65.0%
if 8.5000000000000001e-137 < y < 5.8e-98Initial program 100.0%
Taylor expanded in t around inf 80.7%
Taylor expanded in y around 0 63.9%
mul-1-neg63.9%
*-commutative63.9%
distribute-rgt-neg-in63.9%
Simplified63.9%
Taylor expanded in x around 0 64.1%
associate-*r*64.1%
mul-1-neg64.1%
Simplified64.1%
Final simplification71.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -0.9)
t_1
(if (<= y 9.5e-137)
(+ x (* z x))
(if (<= y 1.6e-98) (* z (- t)) (if (<= y 0.1) (+ x (* y t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -0.9) {
tmp = t_1;
} else if (y <= 9.5e-137) {
tmp = x + (z * x);
} else if (y <= 1.6e-98) {
tmp = z * -t;
} else if (y <= 0.1) {
tmp = x + (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) :: tmp
t_1 = y * (t - x)
if (y <= (-0.9d0)) then
tmp = t_1
else if (y <= 9.5d-137) then
tmp = x + (z * x)
else if (y <= 1.6d-98) then
tmp = z * -t
else if (y <= 0.1d0) then
tmp = x + (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 * (t - x);
double tmp;
if (y <= -0.9) {
tmp = t_1;
} else if (y <= 9.5e-137) {
tmp = x + (z * x);
} else if (y <= 1.6e-98) {
tmp = z * -t;
} else if (y <= 0.1) {
tmp = x + (y * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -0.9: tmp = t_1 elif y <= 9.5e-137: tmp = x + (z * x) elif y <= 1.6e-98: tmp = z * -t elif y <= 0.1: tmp = x + (y * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -0.9) tmp = t_1; elseif (y <= 9.5e-137) tmp = Float64(x + Float64(z * x)); elseif (y <= 1.6e-98) tmp = Float64(z * Float64(-t)); elseif (y <= 0.1) tmp = Float64(x + Float64(y * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); tmp = 0.0; if (y <= -0.9) tmp = t_1; elseif (y <= 9.5e-137) tmp = x + (z * x); elseif (y <= 1.6e-98) tmp = z * -t; elseif (y <= 0.1) tmp = x + (y * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.9], t$95$1, If[LessEqual[y, 9.5e-137], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-98], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 0.1], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -0.9:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-137}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-98}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 0.1:\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -0.900000000000000022 or 0.10000000000000001 < y Initial program 100.0%
Taylor expanded in y around inf 78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in y around inf 78.2%
Taylor expanded in y around inf 77.6%
if -0.900000000000000022 < y < 9.5000000000000007e-137Initial program 100.0%
Taylor expanded in t around 0 65.4%
mul-1-neg65.4%
distribute-rgt-neg-in65.4%
neg-sub065.4%
sub-neg65.4%
+-commutative65.4%
associate--r+65.4%
neg-sub065.4%
remove-double-neg65.4%
Simplified65.4%
Taylor expanded in y around 0 64.7%
if 9.5000000000000007e-137 < y < 1.6e-98Initial program 100.0%
Taylor expanded in t around inf 80.7%
Taylor expanded in y around 0 63.9%
mul-1-neg63.9%
*-commutative63.9%
distribute-rgt-neg-in63.9%
Simplified63.9%
Taylor expanded in x around 0 64.1%
associate-*r*64.1%
mul-1-neg64.1%
Simplified64.1%
if 1.6e-98 < y < 0.10000000000000001Initial program 99.9%
Taylor expanded in t around inf 85.3%
Taylor expanded in y around inf 71.7%
*-commutative71.7%
Simplified71.7%
Final simplification72.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (- x (* z t))))
(if (<= y -36000.0)
t_1
(if (<= y -1.7e-131)
t_2
(if (<= y -4.1e-223) (+ x (* z x)) (if (<= y 0.000135) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x - (z * t);
double tmp;
if (y <= -36000.0) {
tmp = t_1;
} else if (y <= -1.7e-131) {
tmp = t_2;
} else if (y <= -4.1e-223) {
tmp = x + (z * x);
} else if (y <= 0.000135) {
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 = y * (t - x)
t_2 = x - (z * t)
if (y <= (-36000.0d0)) then
tmp = t_1
else if (y <= (-1.7d-131)) then
tmp = t_2
else if (y <= (-4.1d-223)) then
tmp = x + (z * x)
else if (y <= 0.000135d0) 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 = y * (t - x);
double t_2 = x - (z * t);
double tmp;
if (y <= -36000.0) {
tmp = t_1;
} else if (y <= -1.7e-131) {
tmp = t_2;
} else if (y <= -4.1e-223) {
tmp = x + (z * x);
} else if (y <= 0.000135) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x - (z * t) tmp = 0 if y <= -36000.0: tmp = t_1 elif y <= -1.7e-131: tmp = t_2 elif y <= -4.1e-223: tmp = x + (z * x) elif y <= 0.000135: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(x - Float64(z * t)) tmp = 0.0 if (y <= -36000.0) tmp = t_1; elseif (y <= -1.7e-131) tmp = t_2; elseif (y <= -4.1e-223) tmp = Float64(x + Float64(z * x)); elseif (y <= 0.000135) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = x - (z * t); tmp = 0.0; if (y <= -36000.0) tmp = t_1; elseif (y <= -1.7e-131) tmp = t_2; elseif (y <= -4.1e-223) tmp = x + (z * x); elseif (y <= 0.000135) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -36000.0], t$95$1, If[LessEqual[y, -1.7e-131], t$95$2, If[LessEqual[y, -4.1e-223], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.000135], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x - z \cdot t\\
\mathbf{if}\;y \leq -36000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{-131}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -4.1 \cdot 10^{-223}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;y \leq 0.000135:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -36000 or 1.35000000000000002e-4 < y Initial program 100.0%
Taylor expanded in y around inf 78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in y around inf 78.7%
Taylor expanded in y around inf 78.2%
if -36000 < y < -1.69999999999999998e-131 or -4.10000000000000015e-223 < y < 1.35000000000000002e-4Initial program 100.0%
Taylor expanded in t around inf 82.4%
Taylor expanded in y around 0 75.2%
mul-1-neg75.2%
*-commutative75.2%
distribute-rgt-neg-in75.2%
Simplified75.2%
Taylor expanded in x around 0 75.2%
mul-1-neg75.2%
sub-neg75.2%
Simplified75.2%
if -1.69999999999999998e-131 < y < -4.10000000000000015e-223Initial program 100.0%
Taylor expanded in t around 0 83.1%
mul-1-neg83.1%
distribute-rgt-neg-in83.1%
neg-sub083.1%
sub-neg83.1%
+-commutative83.1%
associate--r+83.1%
neg-sub083.1%
remove-double-neg83.1%
Simplified83.1%
Taylor expanded in y around 0 83.1%
Final simplification77.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -1500.0)
(* y t)
(if (<= y 2.4e-200)
x
(if (<= y 7.5e-179) (* z x) (if (<= y 1.25e-6) x (* y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1500.0) {
tmp = y * t;
} else if (y <= 2.4e-200) {
tmp = x;
} else if (y <= 7.5e-179) {
tmp = z * x;
} else if (y <= 1.25e-6) {
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 <= (-1500.0d0)) then
tmp = y * t
else if (y <= 2.4d-200) then
tmp = x
else if (y <= 7.5d-179) then
tmp = z * x
else if (y <= 1.25d-6) 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 <= -1500.0) {
tmp = y * t;
} else if (y <= 2.4e-200) {
tmp = x;
} else if (y <= 7.5e-179) {
tmp = z * x;
} else if (y <= 1.25e-6) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1500.0: tmp = y * t elif y <= 2.4e-200: tmp = x elif y <= 7.5e-179: tmp = z * x elif y <= 1.25e-6: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1500.0) tmp = Float64(y * t); elseif (y <= 2.4e-200) tmp = x; elseif (y <= 7.5e-179) tmp = Float64(z * x); elseif (y <= 1.25e-6) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1500.0) tmp = y * t; elseif (y <= 2.4e-200) tmp = x; elseif (y <= 7.5e-179) tmp = z * x; elseif (y <= 1.25e-6) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1500.0], N[(y * t), $MachinePrecision], If[LessEqual[y, 2.4e-200], x, If[LessEqual[y, 7.5e-179], N[(z * x), $MachinePrecision], If[LessEqual[y, 1.25e-6], x, N[(y * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1500:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-200}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-179}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -1500 or 1.2500000000000001e-6 < y Initial program 100.0%
Taylor expanded in y around inf 78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in y around inf 78.2%
Taylor expanded in t around inf 46.5%
*-commutative46.5%
Simplified46.5%
if -1500 < y < 2.40000000000000002e-200 or 7.4999999999999996e-179 < y < 1.2500000000000001e-6Initial program 100.0%
Taylor expanded in t around inf 81.0%
Taylor expanded in x around inf 42.9%
if 2.40000000000000002e-200 < y < 7.4999999999999996e-179Initial program 100.0%
Taylor expanded in x around inf 63.5%
mul-1-neg63.5%
unsub-neg63.5%
Simplified63.5%
Taylor expanded in z around inf 63.5%
Final simplification45.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.9e+106) (not (<= x 9e-34))) (* x (+ (- z y) 1.0)) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.9e+106) || !(x <= 9e-34)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = x + ((y - z) * 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 ((x <= (-2.9d+106)) .or. (.not. (x <= 9d-34))) then
tmp = x * ((z - y) + 1.0d0)
else
tmp = x + ((y - z) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.9e+106) || !(x <= 9e-34)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.9e+106) or not (x <= 9e-34): tmp = x * ((z - y) + 1.0) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.9e+106) || !(x <= 9e-34)) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); else tmp = Float64(x + Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.9e+106) || ~((x <= 9e-34))) tmp = x * ((z - y) + 1.0); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.9e+106], N[Not[LessEqual[x, 9e-34]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+106} \lor \neg \left(x \leq 9 \cdot 10^{-34}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -2.9000000000000002e106 or 9.00000000000000085e-34 < x Initial program 100.0%
Taylor expanded in x around inf 87.8%
mul-1-neg87.8%
unsub-neg87.8%
Simplified87.8%
if -2.9000000000000002e106 < x < 9.00000000000000085e-34Initial program 100.0%
Taylor expanded in t around inf 87.9%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (<= x -2.35e+106) (* x (+ (- z y) 1.0)) (if (<= x 9e-34) (+ x (* (- y z) t)) (+ x (* x (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.35e+106) {
tmp = x * ((z - y) + 1.0);
} else if (x <= 9e-34) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
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 (x <= (-2.35d+106)) then
tmp = x * ((z - y) + 1.0d0)
else if (x <= 9d-34) then
tmp = x + ((y - z) * t)
else
tmp = x + (x * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.35e+106) {
tmp = x * ((z - y) + 1.0);
} else if (x <= 9e-34) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.35e+106: tmp = x * ((z - y) + 1.0) elif x <= 9e-34: tmp = x + ((y - z) * t) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.35e+106) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); elseif (x <= 9e-34) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x + Float64(x * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.35e+106) tmp = x * ((z - y) + 1.0); elseif (x <= 9e-34) tmp = x + ((y - z) * t); else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.35e+106], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e-34], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.35 \cdot 10^{+106}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-34}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if x < -2.35000000000000012e106Initial program 100.0%
Taylor expanded in x around inf 88.8%
mul-1-neg88.8%
unsub-neg88.8%
Simplified88.8%
if -2.35000000000000012e106 < x < 9.00000000000000085e-34Initial program 100.0%
Taylor expanded in t around inf 87.9%
if 9.00000000000000085e-34 < x Initial program 100.0%
Taylor expanded in t around 0 87.2%
mul-1-neg87.2%
distribute-rgt-neg-in87.2%
neg-sub087.2%
sub-neg87.2%
+-commutative87.2%
associate--r+87.2%
neg-sub087.2%
remove-double-neg87.2%
Simplified87.2%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9.5e-12) (not (<= z 1.0))) (* z x) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e-12) || !(z <= 1.0)) {
tmp = z * x;
} else {
tmp = 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 <= (-9.5d-12)) .or. (.not. (z <= 1.0d0))) then
tmp = z * x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e-12) || !(z <= 1.0)) {
tmp = z * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9.5e-12) or not (z <= 1.0): tmp = z * x else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9.5e-12) || !(z <= 1.0)) tmp = Float64(z * x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9.5e-12) || ~((z <= 1.0))) tmp = z * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.5e-12], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-12} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.4999999999999995e-12 or 1 < z Initial program 100.0%
Taylor expanded in x around inf 44.8%
mul-1-neg44.8%
unsub-neg44.8%
Simplified44.8%
Taylor expanded in z around inf 34.4%
if -9.4999999999999995e-12 < z < 1Initial program 100.0%
Taylor expanded in t around inf 76.3%
Taylor expanded in x around inf 37.6%
Final simplification36.1%
(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 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 69.0%
Taylor expanded in x around inf 20.2%
Final simplification20.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 2024067
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:alt
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))