
(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 14 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 (+ (* 2.0 (+ y z)) t) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, ((2.0 * (y + z)) + t), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(Float64(2.0 * Float64(y + z)) + t), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, 2 \cdot \left(y + z\right) + t, y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -2.55e+42)
(* x (* 2.0 y))
(if (<= x -1.4e-91)
t_1
(if (<= x -6e-131)
(* y 5.0)
(if (<= x -7e-176)
t_1
(if (<= x 1.15e-71)
(* y 5.0)
(if (or (<= x 2.8e-24) (not (<= x 3.2e+189))) t_1 (* x t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -2.55e+42) {
tmp = x * (2.0 * y);
} else if (x <= -1.4e-91) {
tmp = t_1;
} else if (x <= -6e-131) {
tmp = y * 5.0;
} else if (x <= -7e-176) {
tmp = t_1;
} else if (x <= 1.15e-71) {
tmp = y * 5.0;
} else if ((x <= 2.8e-24) || !(x <= 3.2e+189)) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * z)
if (x <= (-2.55d+42)) then
tmp = x * (2.0d0 * y)
else if (x <= (-1.4d-91)) then
tmp = t_1
else if (x <= (-6d-131)) then
tmp = y * 5.0d0
else if (x <= (-7d-176)) then
tmp = t_1
else if (x <= 1.15d-71) then
tmp = y * 5.0d0
else if ((x <= 2.8d-24) .or. (.not. (x <= 3.2d+189))) then
tmp = t_1
else
tmp = x * t
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.55e+42) {
tmp = x * (2.0 * y);
} else if (x <= -1.4e-91) {
tmp = t_1;
} else if (x <= -6e-131) {
tmp = y * 5.0;
} else if (x <= -7e-176) {
tmp = t_1;
} else if (x <= 1.15e-71) {
tmp = y * 5.0;
} else if ((x <= 2.8e-24) || !(x <= 3.2e+189)) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if x <= -2.55e+42: tmp = x * (2.0 * y) elif x <= -1.4e-91: tmp = t_1 elif x <= -6e-131: tmp = y * 5.0 elif x <= -7e-176: tmp = t_1 elif x <= 1.15e-71: tmp = y * 5.0 elif (x <= 2.8e-24) or not (x <= 3.2e+189): tmp = t_1 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (x <= -2.55e+42) tmp = Float64(x * Float64(2.0 * y)); elseif (x <= -1.4e-91) tmp = t_1; elseif (x <= -6e-131) tmp = Float64(y * 5.0); elseif (x <= -7e-176) tmp = t_1; elseif (x <= 1.15e-71) tmp = Float64(y * 5.0); elseif ((x <= 2.8e-24) || !(x <= 3.2e+189)) tmp = t_1; else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (x <= -2.55e+42) tmp = x * (2.0 * y); elseif (x <= -1.4e-91) tmp = t_1; elseif (x <= -6e-131) tmp = y * 5.0; elseif (x <= -7e-176) tmp = t_1; elseif (x <= 1.15e-71) tmp = y * 5.0; elseif ((x <= 2.8e-24) || ~((x <= 3.2e+189))) tmp = t_1; else tmp = x * t; 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.55e+42], N[(x * N[(2.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.4e-91], t$95$1, If[LessEqual[x, -6e-131], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, -7e-176], t$95$1, If[LessEqual[x, 1.15e-71], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 2.8e-24], N[Not[LessEqual[x, 3.2e+189]], $MachinePrecision]], t$95$1, N[(x * t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -2.55 \cdot 10^{+42}:\\
\;\;\;\;x \cdot \left(2 \cdot y\right)\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-131}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-176}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-71}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-24} \lor \neg \left(x \leq 3.2 \cdot 10^{+189}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -2.55e42Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in y around inf 49.1%
associate-*r*49.1%
*-commutative49.1%
associate-*r*49.1%
Simplified49.1%
if -2.55e42 < x < -1.4e-91 or -5.99999999999999992e-131 < x < -7e-176 or 1.1499999999999999e-71 < x < 2.8000000000000002e-24 or 3.2000000000000001e189 < x Initial program 100.0%
Taylor expanded in z around inf 59.4%
if -1.4e-91 < x < -5.99999999999999992e-131 or -7e-176 < x < 1.1499999999999999e-71Initial program 99.8%
Taylor expanded in x around 0 78.5%
if 2.8000000000000002e-24 < x < 3.2000000000000001e189Initial program 99.9%
Taylor expanded in t around inf 46.4%
Simplified46.4%
Final simplification61.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x (+ y z)))))
(if (<= x -1.4e-91)
t_1
(if (<= x -6.8e-130)
(* y 5.0)
(if (<= x -7e-176)
(* 2.0 (* x z))
(if (<= x 8.5e-72)
(* y 5.0)
(if (or (<= x 4.1e-24) (not (<= x 2.4e+26))) t_1 (* x t))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * (y + z));
double tmp;
if (x <= -1.4e-91) {
tmp = t_1;
} else if (x <= -6.8e-130) {
tmp = y * 5.0;
} else if (x <= -7e-176) {
tmp = 2.0 * (x * z);
} else if (x <= 8.5e-72) {
tmp = y * 5.0;
} else if ((x <= 4.1e-24) || !(x <= 2.4e+26)) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * (y + z))
if (x <= (-1.4d-91)) then
tmp = t_1
else if (x <= (-6.8d-130)) then
tmp = y * 5.0d0
else if (x <= (-7d-176)) then
tmp = 2.0d0 * (x * z)
else if (x <= 8.5d-72) then
tmp = y * 5.0d0
else if ((x <= 4.1d-24) .or. (.not. (x <= 2.4d+26))) then
tmp = t_1
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * (y + z));
double tmp;
if (x <= -1.4e-91) {
tmp = t_1;
} else if (x <= -6.8e-130) {
tmp = y * 5.0;
} else if (x <= -7e-176) {
tmp = 2.0 * (x * z);
} else if (x <= 8.5e-72) {
tmp = y * 5.0;
} else if ((x <= 4.1e-24) || !(x <= 2.4e+26)) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * (y + z)) tmp = 0 if x <= -1.4e-91: tmp = t_1 elif x <= -6.8e-130: tmp = y * 5.0 elif x <= -7e-176: tmp = 2.0 * (x * z) elif x <= 8.5e-72: tmp = y * 5.0 elif (x <= 4.1e-24) or not (x <= 2.4e+26): tmp = t_1 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * Float64(y + z))) tmp = 0.0 if (x <= -1.4e-91) tmp = t_1; elseif (x <= -6.8e-130) tmp = Float64(y * 5.0); elseif (x <= -7e-176) tmp = Float64(2.0 * Float64(x * z)); elseif (x <= 8.5e-72) tmp = Float64(y * 5.0); elseif ((x <= 4.1e-24) || !(x <= 2.4e+26)) tmp = t_1; else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * (y + z)); tmp = 0.0; if (x <= -1.4e-91) tmp = t_1; elseif (x <= -6.8e-130) tmp = y * 5.0; elseif (x <= -7e-176) tmp = 2.0 * (x * z); elseif (x <= 8.5e-72) tmp = y * 5.0; elseif ((x <= 4.1e-24) || ~((x <= 2.4e+26))) tmp = t_1; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.4e-91], t$95$1, If[LessEqual[x, -6.8e-130], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, -7e-176], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.5e-72], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 4.1e-24], N[Not[LessEqual[x, 2.4e+26]], $MachinePrecision]], t$95$1, N[(x * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-130}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-176}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-72}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-24} \lor \neg \left(x \leq 2.4 \cdot 10^{+26}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -1.4e-91 or 8.50000000000000008e-72 < x < 4.10000000000000015e-24 or 2.40000000000000005e26 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 96.8%
Taylor expanded in t around 0 68.4%
+-commutative68.4%
Simplified68.4%
if -1.4e-91 < x < -6.8000000000000001e-130 or -7e-176 < x < 8.50000000000000008e-72Initial program 99.8%
Taylor expanded in x around 0 78.5%
if -6.8000000000000001e-130 < x < -7e-176Initial program 100.0%
Taylor expanded in z around inf 61.1%
if 4.10000000000000015e-24 < x < 2.40000000000000005e26Initial program 99.8%
Taylor expanded in t around inf 51.6%
Simplified51.6%
Final simplification70.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))) (t_2 (* x (+ t (* 2.0 y)))))
(if (<= x -200000.0)
t_2
(if (<= x -1.45e-92)
t_1
(if (<= x -6e-131)
(* y 5.0)
(if (<= x -7e-176)
t_1
(if (<= x 9.5e-72)
(* y 5.0)
(if (<= x 1.45e-24) (* 2.0 (* x (+ y z))) t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double t_2 = x * (t + (2.0 * y));
double tmp;
if (x <= -200000.0) {
tmp = t_2;
} else if (x <= -1.45e-92) {
tmp = t_1;
} else if (x <= -6e-131) {
tmp = y * 5.0;
} else if (x <= -7e-176) {
tmp = t_1;
} else if (x <= 9.5e-72) {
tmp = y * 5.0;
} else if (x <= 1.45e-24) {
tmp = 2.0 * (x * (y + z));
} 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 = x * (t + (2.0d0 * y))
if (x <= (-200000.0d0)) then
tmp = t_2
else if (x <= (-1.45d-92)) then
tmp = t_1
else if (x <= (-6d-131)) then
tmp = y * 5.0d0
else if (x <= (-7d-176)) then
tmp = t_1
else if (x <= 9.5d-72) then
tmp = y * 5.0d0
else if (x <= 1.45d-24) then
tmp = 2.0d0 * (x * (y + z))
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 = x * (t + (2.0 * y));
double tmp;
if (x <= -200000.0) {
tmp = t_2;
} else if (x <= -1.45e-92) {
tmp = t_1;
} else if (x <= -6e-131) {
tmp = y * 5.0;
} else if (x <= -7e-176) {
tmp = t_1;
} else if (x <= 9.5e-72) {
tmp = y * 5.0;
} else if (x <= 1.45e-24) {
tmp = 2.0 * (x * (y + z));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) t_2 = x * (t + (2.0 * y)) tmp = 0 if x <= -200000.0: tmp = t_2 elif x <= -1.45e-92: tmp = t_1 elif x <= -6e-131: tmp = y * 5.0 elif x <= -7e-176: tmp = t_1 elif x <= 9.5e-72: tmp = y * 5.0 elif x <= 1.45e-24: tmp = 2.0 * (x * (y + z)) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) t_2 = Float64(x * Float64(t + Float64(2.0 * y))) tmp = 0.0 if (x <= -200000.0) tmp = t_2; elseif (x <= -1.45e-92) tmp = t_1; elseif (x <= -6e-131) tmp = Float64(y * 5.0); elseif (x <= -7e-176) tmp = t_1; elseif (x <= 9.5e-72) tmp = Float64(y * 5.0); elseif (x <= 1.45e-24) tmp = Float64(2.0 * Float64(x * Float64(y + z))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); t_2 = x * (t + (2.0 * y)); tmp = 0.0; if (x <= -200000.0) tmp = t_2; elseif (x <= -1.45e-92) tmp = t_1; elseif (x <= -6e-131) tmp = y * 5.0; elseif (x <= -7e-176) tmp = t_1; elseif (x <= 9.5e-72) tmp = y * 5.0; elseif (x <= 1.45e-24) tmp = 2.0 * (x * (y + z)); 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[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -200000.0], t$95$2, If[LessEqual[x, -1.45e-92], t$95$1, If[LessEqual[x, -6e-131], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, -7e-176], t$95$1, If[LessEqual[x, 9.5e-72], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.45e-24], N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
t_2 := x \cdot \left(t + 2 \cdot y\right)\\
\mathbf{if}\;x \leq -200000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-131}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-176}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-72}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-24}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2e5 or 1.4499999999999999e-24 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 96.0%
Taylor expanded in z around 0 75.6%
if -2e5 < x < -1.44999999999999992e-92 or -5.99999999999999992e-131 < x < -7e-176Initial program 99.9%
Taylor expanded in z around inf 65.9%
if -1.44999999999999992e-92 < x < -5.99999999999999992e-131 or -7e-176 < x < 9.4999999999999998e-72Initial program 99.8%
Taylor expanded in x around 0 78.5%
if 9.4999999999999998e-72 < x < 1.4499999999999999e-24Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 92.3%
Taylor expanded in t around 0 76.0%
+-commutative76.0%
Simplified76.0%
Final simplification75.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -1.2e-92)
t_1
(if (<= x -2e-130)
(* y 5.0)
(if (<= x -7e-176)
t_1
(if (<= x 4.9e-72)
(* y 5.0)
(if (or (<= x 2.35e-24) (not (<= x 9.2e+187))) t_1 (* x t))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -1.2e-92) {
tmp = t_1;
} else if (x <= -2e-130) {
tmp = y * 5.0;
} else if (x <= -7e-176) {
tmp = t_1;
} else if (x <= 4.9e-72) {
tmp = y * 5.0;
} else if ((x <= 2.35e-24) || !(x <= 9.2e+187)) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * z)
if (x <= (-1.2d-92)) then
tmp = t_1
else if (x <= (-2d-130)) then
tmp = y * 5.0d0
else if (x <= (-7d-176)) then
tmp = t_1
else if (x <= 4.9d-72) then
tmp = y * 5.0d0
else if ((x <= 2.35d-24) .or. (.not. (x <= 9.2d+187))) then
tmp = t_1
else
tmp = x * t
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 <= -1.2e-92) {
tmp = t_1;
} else if (x <= -2e-130) {
tmp = y * 5.0;
} else if (x <= -7e-176) {
tmp = t_1;
} else if (x <= 4.9e-72) {
tmp = y * 5.0;
} else if ((x <= 2.35e-24) || !(x <= 9.2e+187)) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if x <= -1.2e-92: tmp = t_1 elif x <= -2e-130: tmp = y * 5.0 elif x <= -7e-176: tmp = t_1 elif x <= 4.9e-72: tmp = y * 5.0 elif (x <= 2.35e-24) or not (x <= 9.2e+187): tmp = t_1 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (x <= -1.2e-92) tmp = t_1; elseif (x <= -2e-130) tmp = Float64(y * 5.0); elseif (x <= -7e-176) tmp = t_1; elseif (x <= 4.9e-72) tmp = Float64(y * 5.0); elseif ((x <= 2.35e-24) || !(x <= 9.2e+187)) tmp = t_1; else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (x <= -1.2e-92) tmp = t_1; elseif (x <= -2e-130) tmp = y * 5.0; elseif (x <= -7e-176) tmp = t_1; elseif (x <= 4.9e-72) tmp = y * 5.0; elseif ((x <= 2.35e-24) || ~((x <= 9.2e+187))) tmp = t_1; else tmp = x * t; 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, -1.2e-92], t$95$1, If[LessEqual[x, -2e-130], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, -7e-176], t$95$1, If[LessEqual[x, 4.9e-72], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 2.35e-24], N[Not[LessEqual[x, 9.2e+187]], $MachinePrecision]], t$95$1, N[(x * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-130}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-176}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-72}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{-24} \lor \neg \left(x \leq 9.2 \cdot 10^{+187}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -1.2000000000000001e-92 or -2.0000000000000002e-130 < x < -7e-176 or 4.89999999999999991e-72 < x < 2.34999999999999996e-24 or 9.20000000000000015e187 < x Initial program 100.0%
Taylor expanded in z around inf 51.6%
if -1.2000000000000001e-92 < x < -2.0000000000000002e-130 or -7e-176 < x < 4.89999999999999991e-72Initial program 99.8%
Taylor expanded in x around 0 78.5%
if 2.34999999999999996e-24 < x < 9.20000000000000015e187Initial program 99.9%
Taylor expanded in t around inf 46.4%
Simplified46.4%
Final simplification60.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* 2.0 z)))) (t_2 (* x (+ t (* 2.0 y)))))
(if (<= x -2.65e+48)
t_2
(if (<= x -2.4e-187)
t_1
(if (<= x 6e-132) (* y 5.0) (if (<= x 3e+27) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (2.0 * z));
double t_2 = x * (t + (2.0 * y));
double tmp;
if (x <= -2.65e+48) {
tmp = t_2;
} else if (x <= -2.4e-187) {
tmp = t_1;
} else if (x <= 6e-132) {
tmp = y * 5.0;
} else if (x <= 3e+27) {
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 * (t + (2.0d0 * z))
t_2 = x * (t + (2.0d0 * y))
if (x <= (-2.65d+48)) then
tmp = t_2
else if (x <= (-2.4d-187)) then
tmp = t_1
else if (x <= 6d-132) then
tmp = y * 5.0d0
else if (x <= 3d+27) 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 * (t + (2.0 * z));
double t_2 = x * (t + (2.0 * y));
double tmp;
if (x <= -2.65e+48) {
tmp = t_2;
} else if (x <= -2.4e-187) {
tmp = t_1;
} else if (x <= 6e-132) {
tmp = y * 5.0;
} else if (x <= 3e+27) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (2.0 * z)) t_2 = x * (t + (2.0 * y)) tmp = 0 if x <= -2.65e+48: tmp = t_2 elif x <= -2.4e-187: tmp = t_1 elif x <= 6e-132: tmp = y * 5.0 elif x <= 3e+27: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(2.0 * z))) t_2 = Float64(x * Float64(t + Float64(2.0 * y))) tmp = 0.0 if (x <= -2.65e+48) tmp = t_2; elseif (x <= -2.4e-187) tmp = t_1; elseif (x <= 6e-132) tmp = Float64(y * 5.0); elseif (x <= 3e+27) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (2.0 * z)); t_2 = x * (t + (2.0 * y)); tmp = 0.0; if (x <= -2.65e+48) tmp = t_2; elseif (x <= -2.4e-187) tmp = t_1; elseif (x <= 6e-132) tmp = y * 5.0; elseif (x <= 3e+27) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.65e+48], t$95$2, If[LessEqual[x, -2.4e-187], t$95$1, If[LessEqual[x, 6e-132], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 3e+27], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + 2 \cdot z\right)\\
t_2 := x \cdot \left(t + 2 \cdot y\right)\\
\mathbf{if}\;x \leq -2.65 \cdot 10^{+48}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{-187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-132}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.65e48 or 2.99999999999999976e27 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in z around 0 78.8%
if -2.65e48 < x < -2.40000000000000013e-187 or 5.9999999999999999e-132 < x < 2.99999999999999976e27Initial program 99.9%
Taylor expanded in y around 0 71.5%
if -2.40000000000000013e-187 < x < 5.9999999999999999e-132Initial program 99.8%
Taylor expanded in x around 0 86.3%
Final simplification78.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -28500.0) (not (<= x 3.7e-7))) (* x (+ (* 2.0 (+ y z)) t)) (+ (+ (* z (* x 2.0)) (* x t)) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -28500.0) || !(x <= 3.7e-7)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = ((z * (x * 2.0)) + (x * t)) + (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 <= (-28500.0d0)) .or. (.not. (x <= 3.7d-7))) then
tmp = x * ((2.0d0 * (y + z)) + t)
else
tmp = ((z * (x * 2.0d0)) + (x * t)) + (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 <= -28500.0) || !(x <= 3.7e-7)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = ((z * (x * 2.0)) + (x * t)) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -28500.0) or not (x <= 3.7e-7): tmp = x * ((2.0 * (y + z)) + t) else: tmp = ((z * (x * 2.0)) + (x * t)) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -28500.0) || !(x <= 3.7e-7)) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); else tmp = Float64(Float64(Float64(z * Float64(x * 2.0)) + Float64(x * t)) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -28500.0) || ~((x <= 3.7e-7))) tmp = x * ((2.0 * (y + z)) + t); else tmp = ((z * (x * 2.0)) + (x * t)) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -28500.0], N[Not[LessEqual[x, 3.7e-7]], $MachinePrecision]], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -28500 \lor \neg \left(x \leq 3.7 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(x \cdot 2\right) + x \cdot t\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -28500 or 3.70000000000000004e-7 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.2%
if -28500 < x < 3.70000000000000004e-7Initial program 99.9%
Taylor expanded in y around 0 99.6%
distribute-rgt-in99.6%
*-commutative99.6%
*-commutative99.6%
associate-*l*99.6%
Applied egg-rr99.6%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -28500.0) (not (<= x 3.7e-7))) (* x (+ (* 2.0 (+ y z)) t)) (+ (* x (+ t (* 2.0 z))) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -28500.0) || !(x <= 3.7e-7)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (x * (t + (2.0 * z))) + (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 <= (-28500.0d0)) .or. (.not. (x <= 3.7d-7))) then
tmp = x * ((2.0d0 * (y + z)) + t)
else
tmp = (x * (t + (2.0d0 * z))) + (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 <= -28500.0) || !(x <= 3.7e-7)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (x * (t + (2.0 * z))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -28500.0) or not (x <= 3.7e-7): tmp = x * ((2.0 * (y + z)) + t) else: tmp = (x * (t + (2.0 * z))) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -28500.0) || !(x <= 3.7e-7)) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); else tmp = Float64(Float64(x * Float64(t + Float64(2.0 * z))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -28500.0) || ~((x <= 3.7e-7))) tmp = x * ((2.0 * (y + z)) + t); else tmp = (x * (t + (2.0 * z))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -28500.0], N[Not[LessEqual[x, 3.7e-7]], $MachinePrecision]], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -28500 \lor \neg \left(x \leq 3.7 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -28500 or 3.70000000000000004e-7 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.2%
if -28500 < x < 3.70000000000000004e-7Initial program 99.9%
Taylor expanded in y around 0 99.6%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.3e-187) (not (<= x 7e-147))) (* x (+ (* 2.0 (+ y z)) t)) (* y (+ 5.0 (* x 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.3e-187) || !(x <= 7e-147)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = y * (5.0 + (x * 2.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 <= (-2.3d-187)) .or. (.not. (x <= 7d-147))) then
tmp = x * ((2.0d0 * (y + z)) + t)
else
tmp = y * (5.0d0 + (x * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.3e-187) || !(x <= 7e-147)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = y * (5.0 + (x * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.3e-187) or not (x <= 7e-147): tmp = x * ((2.0 * (y + z)) + t) else: tmp = y * (5.0 + (x * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.3e-187) || !(x <= 7e-147)) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); else tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.3e-187) || ~((x <= 7e-147))) tmp = x * ((2.0 * (y + z)) + t); else tmp = y * (5.0 + (x * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.3e-187], N[Not[LessEqual[x, 7e-147]], $MachinePrecision]], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{-187} \lor \neg \left(x \leq 7 \cdot 10^{-147}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\end{array}
\end{array}
if x < -2.29999999999999998e-187 or 7.00000000000000007e-147 < x Initial program 99.9%
fma-def99.9%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 88.0%
if -2.29999999999999998e-187 < x < 7.00000000000000007e-147Initial program 99.8%
Taylor expanded in y around inf 86.3%
Simplified86.3%
Final simplification87.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -28500.0) (not (<= x 9.8e-126))) (* x (+ (* 2.0 (+ y z)) t)) (+ (* z (* x 2.0)) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -28500.0) || !(x <= 9.8e-126)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (z * (x * 2.0)) + (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 <= (-28500.0d0)) .or. (.not. (x <= 9.8d-126))) then
tmp = x * ((2.0d0 * (y + z)) + t)
else
tmp = (z * (x * 2.0d0)) + (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 <= -28500.0) || !(x <= 9.8e-126)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (z * (x * 2.0)) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -28500.0) or not (x <= 9.8e-126): tmp = x * ((2.0 * (y + z)) + t) else: tmp = (z * (x * 2.0)) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -28500.0) || !(x <= 9.8e-126)) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); else tmp = Float64(Float64(z * Float64(x * 2.0)) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -28500.0) || ~((x <= 9.8e-126))) tmp = x * ((2.0 * (y + z)) + t); else tmp = (z * (x * 2.0)) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -28500.0], N[Not[LessEqual[x, 9.8e-126]], $MachinePrecision]], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -28500 \lor \neg \left(x \leq 9.8 \cdot 10^{-126}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot 2\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -28500 or 9.8000000000000002e-126 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 93.5%
if -28500 < x < 9.8000000000000002e-126Initial program 99.9%
distribute-rgt-in99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
*-commutative99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 93.7%
associate-*r*93.7%
*-commutative93.7%
Simplified93.7%
Final simplification93.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.9e+26) (not (<= y 1e+42))) (* 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 <= -1.9e+26) || !(y <= 1e+42)) {
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 <= (-1.9d+26)) .or. (.not. (y <= 1d+42))) 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 <= -1.9e+26) || !(y <= 1e+42)) {
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 <= -1.9e+26) or not (y <= 1e+42): 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 <= -1.9e+26) || !(y <= 1e+42)) 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 <= -1.9e+26) || ~((y <= 1e+42))) 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, -1.9e+26], N[Not[LessEqual[y, 1e+42]], $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 -1.9 \cdot 10^{+26} \lor \neg \left(y \leq 10^{+42}\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 < -1.9000000000000001e26 or 1.00000000000000004e42 < y Initial program 99.9%
Taylor expanded in y around inf 77.5%
Simplified77.5%
if -1.9000000000000001e26 < y < 1.00000000000000004e42Initial program 99.9%
Taylor expanded in y around 0 75.4%
Final simplification76.4%
(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 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -9e-15) (not (<= x 9.5e-18))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9e-15) || !(x <= 9.5e-18)) {
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 <= (-9d-15)) .or. (.not. (x <= 9.5d-18))) 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 <= -9e-15) || !(x <= 9.5e-18)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -9e-15) or not (x <= 9.5e-18): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -9e-15) || !(x <= 9.5e-18)) 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 <= -9e-15) || ~((x <= 9.5e-18))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -9e-15], N[Not[LessEqual[x, 9.5e-18]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{-15} \lor \neg \left(x \leq 9.5 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -8.9999999999999995e-15 or 9.5000000000000003e-18 < x Initial program 99.9%
Taylor expanded in t around inf 39.2%
Simplified39.2%
if -8.9999999999999995e-15 < x < 9.5000000000000003e-18Initial program 99.9%
Taylor expanded in x around 0 61.0%
Final simplification50.5%
(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 99.9%
Taylor expanded in x around 0 33.2%
Final simplification33.2%
herbie shell --seed 2024036
(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)))