
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
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) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
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) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (fma x (fma 2.0 (+ y z) t) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, fma(2.0, (y + z), t), (y * 5.0));
}
function code(x, y, z, t) return fma(x, fma(2.0, Float64(y + z), t), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), y \cdot 5\right)
\end{array}
Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
fma-define100.0%
Simplified100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))) (t_2 (* y (* x 2.0))))
(if (<= x -5.5e+186)
t_1
(if (<= x -2.05e+52)
t_2
(if (<= x -6.6e-95)
(* x t)
(if (<= x 2.75e-14) (* y 5.0) (if (<= x 1.4e+82) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double t_2 = y * (x * 2.0);
double tmp;
if (x <= -5.5e+186) {
tmp = t_1;
} else if (x <= -2.05e+52) {
tmp = t_2;
} else if (x <= -6.6e-95) {
tmp = x * t;
} else if (x <= 2.75e-14) {
tmp = y * 5.0;
} else if (x <= 1.4e+82) {
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 = 2.0d0 * (x * z)
t_2 = y * (x * 2.0d0)
if (x <= (-5.5d+186)) then
tmp = t_1
else if (x <= (-2.05d+52)) then
tmp = t_2
else if (x <= (-6.6d-95)) then
tmp = x * t
else if (x <= 2.75d-14) then
tmp = y * 5.0d0
else if (x <= 1.4d+82) 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 = 2.0 * (x * z);
double t_2 = y * (x * 2.0);
double tmp;
if (x <= -5.5e+186) {
tmp = t_1;
} else if (x <= -2.05e+52) {
tmp = t_2;
} else if (x <= -6.6e-95) {
tmp = x * t;
} else if (x <= 2.75e-14) {
tmp = y * 5.0;
} else if (x <= 1.4e+82) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) t_2 = y * (x * 2.0) tmp = 0 if x <= -5.5e+186: tmp = t_1 elif x <= -2.05e+52: tmp = t_2 elif x <= -6.6e-95: tmp = x * t elif x <= 2.75e-14: tmp = y * 5.0 elif x <= 1.4e+82: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) t_2 = Float64(y * Float64(x * 2.0)) tmp = 0.0 if (x <= -5.5e+186) tmp = t_1; elseif (x <= -2.05e+52) tmp = t_2; elseif (x <= -6.6e-95) tmp = Float64(x * t); elseif (x <= 2.75e-14) tmp = Float64(y * 5.0); elseif (x <= 1.4e+82) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); t_2 = y * (x * 2.0); tmp = 0.0; if (x <= -5.5e+186) tmp = t_1; elseif (x <= -2.05e+52) tmp = t_2; elseif (x <= -6.6e-95) tmp = x * t; elseif (x <= 2.75e-14) tmp = y * 5.0; elseif (x <= 1.4e+82) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e+186], t$95$1, If[LessEqual[x, -2.05e+52], t$95$2, If[LessEqual[x, -6.6e-95], N[(x * t), $MachinePrecision], If[LessEqual[x, 2.75e-14], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.4e+82], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
t_2 := y \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{+186}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.05 \cdot 10^{+52}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{-95}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.75 \cdot 10^{-14}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -5.4999999999999996e186 or 2.74999999999999996e-14 < x < 1.4e82Initial program 100.0%
Taylor expanded in z around inf 60.8%
if -5.4999999999999996e186 < x < -2.05e52 or 1.4e82 < x Initial program 100.0%
Taylor expanded in y around inf 50.5%
Taylor expanded in x around inf 50.5%
associate-*r*50.5%
*-commutative50.5%
*-commutative50.5%
Simplified50.5%
if -2.05e52 < x < -6.6e-95Initial program 100.0%
Taylor expanded in t around inf 42.0%
if -6.6e-95 < x < 2.74999999999999996e-14Initial program 99.9%
Taylor expanded in x around 0 67.2%
Final simplification57.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -2e+136)
t_1
(if (<= y -6.9e+25)
(+ (* y 5.0) (* x t))
(if (or (<= y -11500.0) (not (<= y 1.08e-48)))
t_1
(* x (+ t (* 2.0 z))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -2e+136) {
tmp = t_1;
} else if (y <= -6.9e+25) {
tmp = (y * 5.0) + (x * t);
} else if ((y <= -11500.0) || !(y <= 1.08e-48)) {
tmp = t_1;
} else {
tmp = x * (t + (2.0 * z));
}
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 * (5.0d0 + (x * 2.0d0))
if (y <= (-2d+136)) then
tmp = t_1
else if (y <= (-6.9d+25)) then
tmp = (y * 5.0d0) + (x * t)
else if ((y <= (-11500.0d0)) .or. (.not. (y <= 1.08d-48))) then
tmp = t_1
else
tmp = x * (t + (2.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -2e+136) {
tmp = t_1;
} else if (y <= -6.9e+25) {
tmp = (y * 5.0) + (x * t);
} else if ((y <= -11500.0) || !(y <= 1.08e-48)) {
tmp = t_1;
} else {
tmp = x * (t + (2.0 * z));
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -2e+136: tmp = t_1 elif y <= -6.9e+25: tmp = (y * 5.0) + (x * t) elif (y <= -11500.0) or not (y <= 1.08e-48): tmp = t_1 else: tmp = x * (t + (2.0 * z)) return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -2e+136) tmp = t_1; elseif (y <= -6.9e+25) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif ((y <= -11500.0) || !(y <= 1.08e-48)) tmp = t_1; else tmp = Float64(x * Float64(t + Float64(2.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -2e+136) tmp = t_1; elseif (y <= -6.9e+25) tmp = (y * 5.0) + (x * t); elseif ((y <= -11500.0) || ~((y <= 1.08e-48))) tmp = t_1; else tmp = x * (t + (2.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+136], t$95$1, If[LessEqual[y, -6.9e+25], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -11500.0], N[Not[LessEqual[y, 1.08e-48]], $MachinePrecision]], t$95$1, N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -2 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6.9 \cdot 10^{+25}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq -11500 \lor \neg \left(y \leq 1.08 \cdot 10^{-48}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\end{array}
\end{array}
if y < -2.00000000000000012e136 or -6.8999999999999998e25 < y < -11500 or 1.08e-48 < y Initial program 100.0%
Taylor expanded in y around inf 80.1%
if -2.00000000000000012e136 < y < -6.8999999999999998e25Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around inf 71.3%
Taylor expanded in x around 0 54.2%
Taylor expanded in x around 0 82.8%
if -11500 < y < 1.08e-48Initial program 100.0%
Taylor expanded in y around 0 88.5%
Final simplification83.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* 2.0 (+ y z)))) (t_2 (* x (+ t (* 2.0 z)))))
(if (<= x -5.4e+193)
t_2
(if (<= x -4.8e+55)
t_1
(if (<= x -1e-95) t_2 (if (<= x 1.02e-11) (* y 5.0) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (2.0 * (y + z));
double t_2 = x * (t + (2.0 * z));
double tmp;
if (x <= -5.4e+193) {
tmp = t_2;
} else if (x <= -4.8e+55) {
tmp = t_1;
} else if (x <= -1e-95) {
tmp = t_2;
} else if (x <= 1.02e-11) {
tmp = y * 5.0;
} 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 = x * (2.0d0 * (y + z))
t_2 = x * (t + (2.0d0 * z))
if (x <= (-5.4d+193)) then
tmp = t_2
else if (x <= (-4.8d+55)) then
tmp = t_1
else if (x <= (-1d-95)) then
tmp = t_2
else if (x <= 1.02d-11) then
tmp = y * 5.0d0
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 = x * (2.0 * (y + z));
double t_2 = x * (t + (2.0 * z));
double tmp;
if (x <= -5.4e+193) {
tmp = t_2;
} else if (x <= -4.8e+55) {
tmp = t_1;
} else if (x <= -1e-95) {
tmp = t_2;
} else if (x <= 1.02e-11) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (2.0 * (y + z)) t_2 = x * (t + (2.0 * z)) tmp = 0 if x <= -5.4e+193: tmp = t_2 elif x <= -4.8e+55: tmp = t_1 elif x <= -1e-95: tmp = t_2 elif x <= 1.02e-11: tmp = y * 5.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(2.0 * Float64(y + z))) t_2 = Float64(x * Float64(t + Float64(2.0 * z))) tmp = 0.0 if (x <= -5.4e+193) tmp = t_2; elseif (x <= -4.8e+55) tmp = t_1; elseif (x <= -1e-95) tmp = t_2; elseif (x <= 1.02e-11) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (2.0 * (y + z)); t_2 = x * (t + (2.0 * z)); tmp = 0.0; if (x <= -5.4e+193) tmp = t_2; elseif (x <= -4.8e+55) tmp = t_1; elseif (x <= -1e-95) tmp = t_2; elseif (x <= 1.02e-11) tmp = y * 5.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.4e+193], t$95$2, If[LessEqual[x, -4.8e+55], t$95$1, If[LessEqual[x, -1e-95], t$95$2, If[LessEqual[x, 1.02e-11], N[(y * 5.0), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(2 \cdot \left(y + z\right)\right)\\
t_2 := x \cdot \left(t + 2 \cdot z\right)\\
\mathbf{if}\;x \leq -5.4 \cdot 10^{+193}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-95}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{-11}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.4e193 or -4.7999999999999998e55 < x < -9.99999999999999989e-96Initial program 100.0%
Taylor expanded in y around 0 79.2%
if -5.4e193 < x < -4.7999999999999998e55 or 1.01999999999999994e-11 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around 0 82.7%
Taylor expanded in x around inf 81.3%
associate-*r*81.3%
*-commutative81.3%
associate-*r*81.3%
Simplified81.3%
if -9.99999999999999989e-96 < x < 1.01999999999999994e-11Initial program 99.9%
Taylor expanded in x around 0 67.2%
Final simplification75.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* 2.0 (+ y z))))))
(if (<= x -1e-53)
t_1
(if (<= x -3.3e-242)
(+ (* y 5.0) (* x t))
(if (<= x 2800.0) (+ (* y 5.0) (* 2.0 (* x (+ y z)))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (2.0 * (y + z)));
double tmp;
if (x <= -1e-53) {
tmp = t_1;
} else if (x <= -3.3e-242) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 2800.0) {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
} 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 = x * (t + (2.0d0 * (y + z)))
if (x <= (-1d-53)) then
tmp = t_1
else if (x <= (-3.3d-242)) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 2800.0d0) then
tmp = (y * 5.0d0) + (2.0d0 * (x * (y + z)))
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 = x * (t + (2.0 * (y + z)));
double tmp;
if (x <= -1e-53) {
tmp = t_1;
} else if (x <= -3.3e-242) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 2800.0) {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (2.0 * (y + z))) tmp = 0 if x <= -1e-53: tmp = t_1 elif x <= -3.3e-242: tmp = (y * 5.0) + (x * t) elif x <= 2800.0: tmp = (y * 5.0) + (2.0 * (x * (y + z))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))) tmp = 0.0 if (x <= -1e-53) tmp = t_1; elseif (x <= -3.3e-242) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 2800.0) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * Float64(y + z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (2.0 * (y + z))); tmp = 0.0; if (x <= -1e-53) tmp = t_1; elseif (x <= -3.3e-242) tmp = (y * 5.0) + (x * t); elseif (x <= 2800.0) tmp = (y * 5.0) + (2.0 * (x * (y + z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e-53], t$95$1, If[LessEqual[x, -3.3e-242], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2800.0], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -1 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-242}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 2800:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.00000000000000003e-53 or 2800 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around inf 98.0%
if -1.00000000000000003e-53 < x < -3.29999999999999982e-242Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around inf 77.9%
Taylor expanded in x around 0 63.9%
Taylor expanded in x around 0 85.9%
if -3.29999999999999982e-242 < x < 2800Initial program 99.8%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around 0 89.5%
Final simplification93.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.1e-115) (not (<= x 1.35e-138))) (* x (+ t (+ (* 2.0 (+ y z)) (* 5.0 (/ y x))))) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.1e-115) || !(x <= 1.35e-138)) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = (y * 5.0) + (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 ((x <= (-2.1d-115)) .or. (.not. (x <= 1.35d-138))) then
tmp = x * (t + ((2.0d0 * (y + z)) + (5.0d0 * (y / x))))
else
tmp = (y * 5.0d0) + (x * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.1e-115) || !(x <= 1.35e-138)) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.1e-115) or not (x <= 1.35e-138): tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.1e-115) || !(x <= 1.35e-138)) tmp = Float64(x * Float64(t + Float64(Float64(2.0 * Float64(y + z)) + Float64(5.0 * Float64(y / x))))); else tmp = Float64(Float64(y * 5.0) + Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.1e-115) || ~((x <= 1.35e-138))) tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.1e-115], N[Not[LessEqual[x, 1.35e-138]], $MachinePrecision]], N[(x * N[(t + N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-115} \lor \neg \left(x \leq 1.35 \cdot 10^{-138}\right):\\
\;\;\;\;x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -2.10000000000000002e-115 or 1.35000000000000014e-138 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around inf 99.9%
if -2.10000000000000002e-115 < x < 1.35000000000000014e-138Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around inf 59.9%
Taylor expanded in x around 0 47.7%
Taylor expanded in x around 0 87.7%
Final simplification96.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* 2.0 (+ y z))))))
(if (<= x -8.2e-50)
t_1
(if (<= x -1.05e-240)
(+ (* y 5.0) (* x t))
(if (<= x 1.85e-23) (+ (* y 5.0) (* 2.0 (* x z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (2.0 * (y + z)));
double tmp;
if (x <= -8.2e-50) {
tmp = t_1;
} else if (x <= -1.05e-240) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 1.85e-23) {
tmp = (y * 5.0) + (2.0 * (x * z));
} 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 = x * (t + (2.0d0 * (y + z)))
if (x <= (-8.2d-50)) then
tmp = t_1
else if (x <= (-1.05d-240)) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 1.85d-23) then
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
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 = x * (t + (2.0 * (y + z)));
double tmp;
if (x <= -8.2e-50) {
tmp = t_1;
} else if (x <= -1.05e-240) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 1.85e-23) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (2.0 * (y + z))) tmp = 0 if x <= -8.2e-50: tmp = t_1 elif x <= -1.05e-240: tmp = (y * 5.0) + (x * t) elif x <= 1.85e-23: tmp = (y * 5.0) + (2.0 * (x * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))) tmp = 0.0 if (x <= -8.2e-50) tmp = t_1; elseif (x <= -1.05e-240) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 1.85e-23) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (2.0 * (y + z))); tmp = 0.0; if (x <= -8.2e-50) tmp = t_1; elseif (x <= -1.05e-240) tmp = (y * 5.0) + (x * t); elseif (x <= 1.85e-23) tmp = (y * 5.0) + (2.0 * (x * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.2e-50], t$95$1, If[LessEqual[x, -1.05e-240], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e-23], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -8.2 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-240}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-23}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.19999999999999971e-50 or 1.8500000000000001e-23 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around inf 97.0%
if -8.19999999999999971e-50 < x < -1.04999999999999997e-240Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around inf 77.9%
Taylor expanded in x around 0 63.9%
Taylor expanded in x around 0 85.9%
if -1.04999999999999997e-240 < x < 1.8500000000000001e-23Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around 0 90.2%
Taylor expanded in y around 0 90.2%
Final simplification93.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* 2.0 (+ y z)))))
(if (<= x -2e-53)
t_1
(if (<= x -6.6e-95) (* x t) (if (<= x 6.2e-11) (* y 5.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (2.0 * (y + z));
double tmp;
if (x <= -2e-53) {
tmp = t_1;
} else if (x <= -6.6e-95) {
tmp = x * t;
} else if (x <= 6.2e-11) {
tmp = y * 5.0;
} 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 = x * (2.0d0 * (y + z))
if (x <= (-2d-53)) then
tmp = t_1
else if (x <= (-6.6d-95)) then
tmp = x * t
else if (x <= 6.2d-11) then
tmp = y * 5.0d0
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 = x * (2.0 * (y + z));
double tmp;
if (x <= -2e-53) {
tmp = t_1;
} else if (x <= -6.6e-95) {
tmp = x * t;
} else if (x <= 6.2e-11) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (2.0 * (y + z)) tmp = 0 if x <= -2e-53: tmp = t_1 elif x <= -6.6e-95: tmp = x * t elif x <= 6.2e-11: tmp = y * 5.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(2.0 * Float64(y + z))) tmp = 0.0 if (x <= -2e-53) tmp = t_1; elseif (x <= -6.6e-95) tmp = Float64(x * t); elseif (x <= 6.2e-11) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (2.0 * (y + z)); tmp = 0.0; if (x <= -2e-53) tmp = t_1; elseif (x <= -6.6e-95) tmp = x * t; elseif (x <= 6.2e-11) tmp = y * 5.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e-53], t$95$1, If[LessEqual[x, -6.6e-95], N[(x * t), $MachinePrecision], If[LessEqual[x, 6.2e-11], N[(y * 5.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -2 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{-95}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-11}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.00000000000000006e-53 or 6.20000000000000056e-11 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around 0 78.9%
Taylor expanded in x around inf 75.9%
associate-*r*75.9%
*-commutative75.9%
associate-*r*75.9%
Simplified75.9%
if -2.00000000000000006e-53 < x < -6.6e-95Initial program 100.0%
Taylor expanded in t around inf 60.8%
if -6.6e-95 < x < 6.20000000000000056e-11Initial program 99.9%
Taylor expanded in x around 0 67.2%
Final simplification72.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.4e+26) (not (<= t 0.00075))) (+ (* y 5.0) (* x (+ t (+ y y)))) (+ (* y 5.0) (* 2.0 (* x (+ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.4e+26) || !(t <= 0.00075)) {
tmp = (y * 5.0) + (x * (t + (y + y)));
} else {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
}
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 ((t <= (-1.4d+26)) .or. (.not. (t <= 0.00075d0))) then
tmp = (y * 5.0d0) + (x * (t + (y + y)))
else
tmp = (y * 5.0d0) + (2.0d0 * (x * (y + z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.4e+26) || !(t <= 0.00075)) {
tmp = (y * 5.0) + (x * (t + (y + y)));
} else {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.4e+26) or not (t <= 0.00075): tmp = (y * 5.0) + (x * (t + (y + y))) else: tmp = (y * 5.0) + (2.0 * (x * (y + z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.4e+26) || !(t <= 0.00075)) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + y)))); else tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * Float64(y + z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.4e+26) || ~((t <= 0.00075))) tmp = (y * 5.0) + (x * (t + (y + y))); else tmp = (y * 5.0) + (2.0 * (x * (y + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.4e+26], N[Not[LessEqual[t, 0.00075]], $MachinePrecision]], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+26} \lor \neg \left(t \leq 0.00075\right):\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\end{array}
\end{array}
if t < -1.4e26 or 7.5000000000000002e-4 < t Initial program 100.0%
Taylor expanded in y around inf 91.2%
if -1.4e26 < t < 7.5000000000000002e-4Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around 0 96.7%
Final simplification94.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -2.3e-56)
t_1
(if (<= x -6e-95) (* x t) (if (<= x 1.52e-16) (* y 5.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -2.3e-56) {
tmp = t_1;
} else if (x <= -6e-95) {
tmp = x * t;
} else if (x <= 1.52e-16) {
tmp = y * 5.0;
} 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 = 2.0d0 * (x * z)
if (x <= (-2.3d-56)) then
tmp = t_1
else if (x <= (-6d-95)) then
tmp = x * t
else if (x <= 1.52d-16) then
tmp = y * 5.0d0
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 = 2.0 * (x * z);
double tmp;
if (x <= -2.3e-56) {
tmp = t_1;
} else if (x <= -6e-95) {
tmp = x * t;
} else if (x <= 1.52e-16) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if x <= -2.3e-56: tmp = t_1 elif x <= -6e-95: tmp = x * t elif x <= 1.52e-16: tmp = y * 5.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (x <= -2.3e-56) tmp = t_1; elseif (x <= -6e-95) tmp = Float64(x * t); elseif (x <= 1.52e-16) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (x <= -2.3e-56) tmp = t_1; elseif (x <= -6e-95) tmp = x * t; elseif (x <= 1.52e-16) tmp = y * 5.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.3e-56], t$95$1, If[LessEqual[x, -6e-95], N[(x * t), $MachinePrecision], If[LessEqual[x, 1.52e-16], N[(y * 5.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-95}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 1.52 \cdot 10^{-16}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.30000000000000002e-56 or 1.52e-16 < x Initial program 100.0%
Taylor expanded in z around inf 44.8%
if -2.30000000000000002e-56 < x < -6e-95Initial program 100.0%
Taylor expanded in t around inf 60.8%
if -6e-95 < x < 1.52e-16Initial program 99.9%
Taylor expanded in x around 0 67.2%
Final simplification53.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.95e-53) (not (<= x 5.2e-13))) (* x (+ t (* 2.0 (+ y z)))) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.95e-53) || !(x <= 5.2e-13)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (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 ((x <= (-1.95d-53)) .or. (.not. (x <= 5.2d-13))) then
tmp = x * (t + (2.0d0 * (y + z)))
else
tmp = (y * 5.0d0) + (x * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.95e-53) || !(x <= 5.2e-13)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.95e-53) or not (x <= 5.2e-13): tmp = x * (t + (2.0 * (y + z))) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.95e-53) || !(x <= 5.2e-13)) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); else tmp = Float64(Float64(y * 5.0) + Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.95e-53) || ~((x <= 5.2e-13))) tmp = x * (t + (2.0 * (y + z))); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.95e-53], N[Not[LessEqual[x, 5.2e-13]], $MachinePrecision]], N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{-53} \lor \neg \left(x \leq 5.2 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -1.9500000000000001e-53 or 5.2000000000000001e-13 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around inf 97.0%
if -1.9500000000000001e-53 < x < 5.2000000000000001e-13Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around inf 74.7%
Taylor expanded in x around 0 57.9%
Taylor expanded in x around 0 83.1%
Final simplification91.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3000.0) (not (<= y 1.08e-48))) (* y (+ 5.0 (* x 2.0))) (* x (+ t (* 2.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3000.0) || !(y <= 1.08e-48)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (2.0 * z));
}
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 <= (-3000.0d0)) .or. (.not. (y <= 1.08d-48))) then
tmp = y * (5.0d0 + (x * 2.0d0))
else
tmp = x * (t + (2.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3000.0) || !(y <= 1.08e-48)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (2.0 * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3000.0) or not (y <= 1.08e-48): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (2.0 * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3000.0) || !(y <= 1.08e-48)) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(2.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3000.0) || ~((y <= 1.08e-48))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (2.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3000.0], N[Not[LessEqual[y, 1.08e-48]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3000 \lor \neg \left(y \leq 1.08 \cdot 10^{-48}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\end{array}
\end{array}
if y < -3e3 or 1.08e-48 < y Initial program 99.9%
Taylor expanded in y around inf 76.4%
if -3e3 < y < 1.08e-48Initial program 100.0%
Taylor expanded in y around 0 88.5%
Final simplification81.3%
(FPCore (x y z t) :precision binary64 (if (<= x -9.2e-97) (* x (+ t (* 2.0 y))) (if (<= x 1.76e-15) (* y 5.0) (* x (* 2.0 (+ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.2e-97) {
tmp = x * (t + (2.0 * y));
} else if (x <= 1.76e-15) {
tmp = y * 5.0;
} else {
tmp = x * (2.0 * (y + z));
}
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 <= (-9.2d-97)) then
tmp = x * (t + (2.0d0 * y))
else if (x <= 1.76d-15) then
tmp = y * 5.0d0
else
tmp = x * (2.0d0 * (y + z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.2e-97) {
tmp = x * (t + (2.0 * y));
} else if (x <= 1.76e-15) {
tmp = y * 5.0;
} else {
tmp = x * (2.0 * (y + z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9.2e-97: tmp = x * (t + (2.0 * y)) elif x <= 1.76e-15: tmp = y * 5.0 else: tmp = x * (2.0 * (y + z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9.2e-97) tmp = Float64(x * Float64(t + Float64(2.0 * y))); elseif (x <= 1.76e-15) tmp = Float64(y * 5.0); else tmp = Float64(x * Float64(2.0 * Float64(y + z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -9.2e-97) tmp = x * (t + (2.0 * y)); elseif (x <= 1.76e-15) tmp = y * 5.0; else tmp = x * (2.0 * (y + z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9.2e-97], N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.76e-15], N[(y * 5.0), $MachinePrecision], N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{-97}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot y\right)\\
\mathbf{elif}\;x \leq 1.76 \cdot 10^{-15}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\end{array}
\end{array}
if x < -9.19999999999999976e-97Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around inf 92.3%
Taylor expanded in z around 0 65.2%
if -9.19999999999999976e-97 < x < 1.76e-15Initial program 99.9%
Taylor expanded in x around 0 67.2%
if 1.76e-15 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around 0 83.3%
Taylor expanded in x around inf 81.4%
associate-*r*81.4%
*-commutative81.4%
associate-*r*81.4%
Simplified81.4%
Final simplification70.7%
(FPCore (x y z t) :precision binary64 (+ (* x (+ t (+ y (+ z (+ y z))))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (y * 5.0);
}
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 + (y + z))))) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (y * 5.0);
}
def code(x, y, z, t): return (x * (t + (y + (z + (y + z))))) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z))))) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * (t + (y + (z + (y + z))))) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right) + y \cdot 5
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6.6e-95) (not (<= x 9.5e-24))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.6e-95) || !(x <= 9.5e-24)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
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 <= (-6.6d-95)) .or. (.not. (x <= 9.5d-24))) then
tmp = x * t
else
tmp = y * 5.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.6e-95) || !(x <= 9.5e-24)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -6.6e-95) or not (x <= 9.5e-24): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -6.6e-95) || !(x <= 9.5e-24)) tmp = Float64(x * t); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -6.6e-95) || ~((x <= 9.5e-24))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6.6e-95], N[Not[LessEqual[x, 9.5e-24]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{-95} \lor \neg \left(x \leq 9.5 \cdot 10^{-24}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -6.6e-95 or 9.50000000000000029e-24 < x Initial program 100.0%
Taylor expanded in t around inf 31.2%
if -6.6e-95 < x < 9.50000000000000029e-24Initial program 99.9%
Taylor expanded in x around 0 67.8%
Final simplification43.9%
(FPCore (x y z t) :precision binary64 (* y 5.0))
double code(double x, double y, double z, double t) {
return y * 5.0;
}
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 = y * 5.0d0
end function
public static double code(double x, double y, double z, double t) {
return y * 5.0;
}
def code(x, y, z, t): return y * 5.0
function code(x, y, z, t) return Float64(y * 5.0) end
function tmp = code(x, y, z, t) tmp = y * 5.0; end
code[x_, y_, z_, t_] := N[(y * 5.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5
\end{array}
Initial program 100.0%
Taylor expanded in x around 0 27.6%
Final simplification27.6%
herbie shell --seed 2024096
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
:precision binary64
(+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))