
(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 y 5.0 (* x (fma (+ y z) 2.0 t))))
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * fma((y + z), 2.0, t)));
}
function code(x, y, z, t) return fma(y, 5.0, Float64(x * fma(Float64(y + z), 2.0, t))) end
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(N[(y + z), $MachinePrecision] * 2.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 5, x \cdot \mathsf{fma}\left(y + z, 2, t\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in96.9%
associate-+l+96.9%
+-commutative96.9%
count-296.9%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (fma x (+ t (* (+ y z) 2.0)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, (t + ((y + z) * 2.0)), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(t + Float64(Float64(y + z) * 2.0)), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, t + \left(y + z\right) \cdot 2, y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -1.22e+143)
t_2
(if (<= y -1.05e+76)
t_1
(if (<= y -4.9e+45)
(* y 5.0)
(if (<= y -1.06e-23)
(* (+ y z) (* x 2.0))
(if (or (<= y -2.5e-94) (and (not (<= y -2.4e-116)) (<= y 1e+93)))
t_1
t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.22e+143) {
tmp = t_2;
} else if (y <= -1.05e+76) {
tmp = t_1;
} else if (y <= -4.9e+45) {
tmp = y * 5.0;
} else if (y <= -1.06e-23) {
tmp = (y + z) * (x * 2.0);
} else if ((y <= -2.5e-94) || (!(y <= -2.4e-116) && (y <= 1e+93))) {
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 + (z * 2.0d0))
t_2 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-1.22d+143)) then
tmp = t_2
else if (y <= (-1.05d+76)) then
tmp = t_1
else if (y <= (-4.9d+45)) then
tmp = y * 5.0d0
else if (y <= (-1.06d-23)) then
tmp = (y + z) * (x * 2.0d0)
else if ((y <= (-2.5d-94)) .or. (.not. (y <= (-2.4d-116))) .and. (y <= 1d+93)) 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 + (z * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.22e+143) {
tmp = t_2;
} else if (y <= -1.05e+76) {
tmp = t_1;
} else if (y <= -4.9e+45) {
tmp = y * 5.0;
} else if (y <= -1.06e-23) {
tmp = (y + z) * (x * 2.0);
} else if ((y <= -2.5e-94) || (!(y <= -2.4e-116) && (y <= 1e+93))) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) t_2 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -1.22e+143: tmp = t_2 elif y <= -1.05e+76: tmp = t_1 elif y <= -4.9e+45: tmp = y * 5.0 elif y <= -1.06e-23: tmp = (y + z) * (x * 2.0) elif (y <= -2.5e-94) or (not (y <= -2.4e-116) and (y <= 1e+93)): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) t_2 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -1.22e+143) tmp = t_2; elseif (y <= -1.05e+76) tmp = t_1; elseif (y <= -4.9e+45) tmp = Float64(y * 5.0); elseif (y <= -1.06e-23) tmp = Float64(Float64(y + z) * Float64(x * 2.0)); elseif ((y <= -2.5e-94) || (!(y <= -2.4e-116) && (y <= 1e+93))) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); t_2 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -1.22e+143) tmp = t_2; elseif (y <= -1.05e+76) tmp = t_1; elseif (y <= -4.9e+45) tmp = y * 5.0; elseif (y <= -1.06e-23) tmp = (y + z) * (x * 2.0); elseif ((y <= -2.5e-94) || (~((y <= -2.4e-116)) && (y <= 1e+93))) 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[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.22e+143], t$95$2, If[LessEqual[y, -1.05e+76], t$95$1, If[LessEqual[y, -4.9e+45], N[(y * 5.0), $MachinePrecision], If[LessEqual[y, -1.06e-23], N[(N[(y + z), $MachinePrecision] * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -2.5e-94], And[N[Not[LessEqual[y, -2.4e-116]], $MachinePrecision], LessEqual[y, 1e+93]]], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.22 \cdot 10^{+143}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.9 \cdot 10^{+45}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -1.06 \cdot 10^{-23}:\\
\;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-94} \lor \neg \left(y \leq -2.4 \cdot 10^{-116}\right) \land y \leq 10^{+93}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.22000000000000004e143 or -2.4999999999999998e-94 < y < -2.39999999999999993e-116 or 1.00000000000000004e93 < y Initial program 99.9%
Taylor expanded in y around inf 90.2%
Simplified90.2%
if -1.22000000000000004e143 < y < -1.05000000000000003e76 or -1.05999999999999994e-23 < y < -2.4999999999999998e-94 or -2.39999999999999993e-116 < y < 1.00000000000000004e93Initial program 99.9%
Taylor expanded in y around 0 81.2%
if -1.05000000000000003e76 < y < -4.9000000000000002e45Initial program 99.8%
Taylor expanded in x around 0 58.7%
if -4.9000000000000002e45 < y < -1.05999999999999994e-23Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
associate-*r*100.0%
*-commutative100.0%
fma-def100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 91.8%
*-commutative91.8%
associate-*l*91.8%
*-commutative91.8%
associate-*r*91.8%
Simplified91.8%
Final simplification83.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* x (+ t (* y 2.0)))))
(if (<= x -3.2e+267)
t_2
(if (<= x -1e+163)
t_1
(if (<= x -4.6e+37)
t_2
(if (or (<= x -2.6e-149) (not (<= x 2.4e-152))) t_1 (* y 5.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double t_2 = x * (t + (y * 2.0));
double tmp;
if (x <= -3.2e+267) {
tmp = t_2;
} else if (x <= -1e+163) {
tmp = t_1;
} else if (x <= -4.6e+37) {
tmp = t_2;
} else if ((x <= -2.6e-149) || !(x <= 2.4e-152)) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (t + (z * 2.0d0))
t_2 = x * (t + (y * 2.0d0))
if (x <= (-3.2d+267)) then
tmp = t_2
else if (x <= (-1d+163)) then
tmp = t_1
else if (x <= (-4.6d+37)) then
tmp = t_2
else if ((x <= (-2.6d-149)) .or. (.not. (x <= 2.4d-152))) then
tmp = t_1
else
tmp = y * 5.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double t_2 = x * (t + (y * 2.0));
double tmp;
if (x <= -3.2e+267) {
tmp = t_2;
} else if (x <= -1e+163) {
tmp = t_1;
} else if (x <= -4.6e+37) {
tmp = t_2;
} else if ((x <= -2.6e-149) || !(x <= 2.4e-152)) {
tmp = t_1;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) t_2 = x * (t + (y * 2.0)) tmp = 0 if x <= -3.2e+267: tmp = t_2 elif x <= -1e+163: tmp = t_1 elif x <= -4.6e+37: tmp = t_2 elif (x <= -2.6e-149) or not (x <= 2.4e-152): tmp = t_1 else: tmp = y * 5.0 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) t_2 = Float64(x * Float64(t + Float64(y * 2.0))) tmp = 0.0 if (x <= -3.2e+267) tmp = t_2; elseif (x <= -1e+163) tmp = t_1; elseif (x <= -4.6e+37) tmp = t_2; elseif ((x <= -2.6e-149) || !(x <= 2.4e-152)) tmp = t_1; else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); t_2 = x * (t + (y * 2.0)); tmp = 0.0; if (x <= -3.2e+267) tmp = t_2; elseif (x <= -1e+163) tmp = t_1; elseif (x <= -4.6e+37) tmp = t_2; elseif ((x <= -2.6e-149) || ~((x <= 2.4e-152))) tmp = t_1; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.2e+267], t$95$2, If[LessEqual[x, -1e+163], t$95$1, If[LessEqual[x, -4.6e+37], t$95$2, If[Or[LessEqual[x, -2.6e-149], N[Not[LessEqual[x, 2.4e-152]], $MachinePrecision]], t$95$1, N[(y * 5.0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
t_2 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+267}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1 \cdot 10^{+163}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.6 \cdot 10^{+37}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-149} \lor \neg \left(x \leq 2.4 \cdot 10^{-152}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -3.2000000000000001e267 or -9.9999999999999994e162 < x < -4.60000000000000005e37Initial 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 86.0%
if -3.2000000000000001e267 < x < -9.9999999999999994e162 or -4.60000000000000005e37 < x < -2.59999999999999999e-149 or 2.4e-152 < x Initial program 100.0%
Taylor expanded in y around 0 71.7%
if -2.59999999999999999e-149 < x < 2.4e-152Initial program 99.9%
Taylor expanded in x around 0 70.6%
Final simplification73.3%
(FPCore (x y z t)
:precision binary64
(if (or (<= y -1.22e+143)
(and (not (<= y -2.5e-94))
(or (<= y -2.4e-116) (not (<= y 1.75e+92)))))
(* y (+ 5.0 (* x 2.0)))
(* x (+ t (* (+ y z) 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.22e+143) || (!(y <= -2.5e-94) && ((y <= -2.4e-116) || !(y <= 1.75e+92)))) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + ((y + z) * 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 ((y <= (-1.22d+143)) .or. (.not. (y <= (-2.5d-94))) .and. (y <= (-2.4d-116)) .or. (.not. (y <= 1.75d+92))) then
tmp = y * (5.0d0 + (x * 2.0d0))
else
tmp = x * (t + ((y + z) * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.22e+143) || (!(y <= -2.5e-94) && ((y <= -2.4e-116) || !(y <= 1.75e+92)))) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + ((y + z) * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.22e+143) or (not (y <= -2.5e-94) and ((y <= -2.4e-116) or not (y <= 1.75e+92))): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + ((y + z) * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.22e+143) || (!(y <= -2.5e-94) && ((y <= -2.4e-116) || !(y <= 1.75e+92)))) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.22e+143) || (~((y <= -2.5e-94)) && ((y <= -2.4e-116) || ~((y <= 1.75e+92))))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + ((y + z) * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.22e+143], And[N[Not[LessEqual[y, -2.5e-94]], $MachinePrecision], Or[LessEqual[y, -2.4e-116], N[Not[LessEqual[y, 1.75e+92]], $MachinePrecision]]]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{+143} \lor \neg \left(y \leq -2.5 \cdot 10^{-94}\right) \land \left(y \leq -2.4 \cdot 10^{-116} \lor \neg \left(y \leq 1.75 \cdot 10^{+92}\right)\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\end{array}
\end{array}
if y < -1.22000000000000004e143 or -2.4999999999999998e-94 < y < -2.39999999999999993e-116 or 1.74999999999999993e92 < y Initial program 99.9%
Taylor expanded in y around inf 90.2%
Simplified90.2%
if -1.22000000000000004e143 < y < -2.4999999999999998e-94 or -2.39999999999999993e-116 < y < 1.74999999999999993e92Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 83.5%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (if (<= x -5e+189) (* x (+ t (* (+ y z) 2.0))) (+ (* x (+ t (* z 2.0))) (* y (+ 5.0 (* x 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5e+189) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (x * (t + (z * 2.0))) + (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 <= (-5d+189)) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (x * (t + (z * 2.0d0))) + (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 <= -5e+189) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5e+189: tmp = x * (t + ((y + z) * 2.0)) else: tmp = (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5e+189) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(x * Float64(t + Float64(z * 2.0))) + 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 <= -5e+189) tmp = x * (t + ((y + z) * 2.0)); else tmp = (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5e+189], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+189}:\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right) + y \cdot \left(5 + x \cdot 2\right)\\
\end{array}
\end{array}
if x < -5.0000000000000004e189Initial 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%
if -5.0000000000000004e189 < x Initial program 99.9%
Taylor expanded in y around 0 99.1%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -2.9e+274)
(* x t)
(if (<= x -6e+159)
t_1
(if (<= x -5.5e-14)
(* x t)
(if (<= x 6e-36) (* y 5.0) (if (<= x 1.45e+159) 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.9e+274) {
tmp = x * t;
} else if (x <= -6e+159) {
tmp = t_1;
} else if (x <= -5.5e-14) {
tmp = x * t;
} else if (x <= 6e-36) {
tmp = y * 5.0;
} else if (x <= 1.45e+159) {
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.9d+274)) then
tmp = x * t
else if (x <= (-6d+159)) then
tmp = t_1
else if (x <= (-5.5d-14)) then
tmp = x * t
else if (x <= 6d-36) then
tmp = y * 5.0d0
else if (x <= 1.45d+159) 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.9e+274) {
tmp = x * t;
} else if (x <= -6e+159) {
tmp = t_1;
} else if (x <= -5.5e-14) {
tmp = x * t;
} else if (x <= 6e-36) {
tmp = y * 5.0;
} else if (x <= 1.45e+159) {
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.9e+274: tmp = x * t elif x <= -6e+159: tmp = t_1 elif x <= -5.5e-14: tmp = x * t elif x <= 6e-36: tmp = y * 5.0 elif x <= 1.45e+159: 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.9e+274) tmp = Float64(x * t); elseif (x <= -6e+159) tmp = t_1; elseif (x <= -5.5e-14) tmp = Float64(x * t); elseif (x <= 6e-36) tmp = Float64(y * 5.0); elseif (x <= 1.45e+159) 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.9e+274) tmp = x * t; elseif (x <= -6e+159) tmp = t_1; elseif (x <= -5.5e-14) tmp = x * t; elseif (x <= 6e-36) tmp = y * 5.0; elseif (x <= 1.45e+159) 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.9e+274], N[(x * t), $MachinePrecision], If[LessEqual[x, -6e+159], t$95$1, If[LessEqual[x, -5.5e-14], N[(x * t), $MachinePrecision], If[LessEqual[x, 6e-36], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.45e+159], 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.9 \cdot 10^{+274}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -6 \cdot 10^{+159}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-14}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-36}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+159}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -2.9e274 or -6.0000000000000004e159 < x < -5.49999999999999991e-14 or 1.45000000000000007e159 < x Initial program 100.0%
Taylor expanded in t around inf 49.8%
if -2.9e274 < x < -6.0000000000000004e159 or 6.0000000000000003e-36 < x < 1.45000000000000007e159Initial program 100.0%
Taylor expanded in z around inf 56.8%
if -5.49999999999999991e-14 < x < 6.0000000000000003e-36Initial program 99.9%
Taylor expanded in x around 0 57.0%
Final simplification55.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -2.05e+267)
(* y (* x 2.0))
(if (<= x -4.1e+161)
t_1
(if (<= x -2.25e-15)
(* x t)
(if (<= x 2.5e-35) (* y 5.0) (if (<= x 3.3e+157) 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.05e+267) {
tmp = y * (x * 2.0);
} else if (x <= -4.1e+161) {
tmp = t_1;
} else if (x <= -2.25e-15) {
tmp = x * t;
} else if (x <= 2.5e-35) {
tmp = y * 5.0;
} else if (x <= 3.3e+157) {
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.05d+267)) then
tmp = y * (x * 2.0d0)
else if (x <= (-4.1d+161)) then
tmp = t_1
else if (x <= (-2.25d-15)) then
tmp = x * t
else if (x <= 2.5d-35) then
tmp = y * 5.0d0
else if (x <= 3.3d+157) 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.05e+267) {
tmp = y * (x * 2.0);
} else if (x <= -4.1e+161) {
tmp = t_1;
} else if (x <= -2.25e-15) {
tmp = x * t;
} else if (x <= 2.5e-35) {
tmp = y * 5.0;
} else if (x <= 3.3e+157) {
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.05e+267: tmp = y * (x * 2.0) elif x <= -4.1e+161: tmp = t_1 elif x <= -2.25e-15: tmp = x * t elif x <= 2.5e-35: tmp = y * 5.0 elif x <= 3.3e+157: 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.05e+267) tmp = Float64(y * Float64(x * 2.0)); elseif (x <= -4.1e+161) tmp = t_1; elseif (x <= -2.25e-15) tmp = Float64(x * t); elseif (x <= 2.5e-35) tmp = Float64(y * 5.0); elseif (x <= 3.3e+157) 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.05e+267) tmp = y * (x * 2.0); elseif (x <= -4.1e+161) tmp = t_1; elseif (x <= -2.25e-15) tmp = x * t; elseif (x <= 2.5e-35) tmp = y * 5.0; elseif (x <= 3.3e+157) 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.05e+267], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.1e+161], t$95$1, If[LessEqual[x, -2.25e-15], N[(x * t), $MachinePrecision], If[LessEqual[x, 2.5e-35], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 3.3e+157], 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.05 \cdot 10^{+267}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{+161}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.25 \cdot 10^{-15}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-35}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+157}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -2.04999999999999999e267Initial 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 55.9%
*-commutative55.9%
*-commutative55.9%
associate-*r*55.9%
*-commutative55.9%
Simplified55.9%
if -2.04999999999999999e267 < x < -4.1000000000000001e161 or 2.49999999999999982e-35 < x < 3.3000000000000002e157Initial program 100.0%
Taylor expanded in z around inf 58.6%
if -4.1000000000000001e161 < x < -2.2499999999999999e-15 or 3.3000000000000002e157 < x Initial program 100.0%
Taylor expanded in t around inf 48.7%
if -2.2499999999999999e-15 < x < 2.49999999999999982e-35Initial program 99.9%
Taylor expanded in x around 0 57.0%
Final simplification55.6%
(FPCore (x y z t)
:precision binary64
(if (or (<= y -1.22e+143)
(and (not (<= y -2.5e-94))
(or (<= y -2.4e-116) (not (<= y 2.4e+92)))))
(* y (+ 5.0 (* x 2.0)))
(* x (+ t (* z 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.22e+143) || (!(y <= -2.5e-94) && ((y <= -2.4e-116) || !(y <= 2.4e+92)))) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 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 ((y <= (-1.22d+143)) .or. (.not. (y <= (-2.5d-94))) .and. (y <= (-2.4d-116)) .or. (.not. (y <= 2.4d+92))) then
tmp = y * (5.0d0 + (x * 2.0d0))
else
tmp = x * (t + (z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.22e+143) || (!(y <= -2.5e-94) && ((y <= -2.4e-116) || !(y <= 2.4e+92)))) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.22e+143) or (not (y <= -2.5e-94) and ((y <= -2.4e-116) or not (y <= 2.4e+92))): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.22e+143) || (!(y <= -2.5e-94) && ((y <= -2.4e-116) || !(y <= 2.4e+92)))) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(z * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.22e+143) || (~((y <= -2.5e-94)) && ((y <= -2.4e-116) || ~((y <= 2.4e+92))))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.22e+143], And[N[Not[LessEqual[y, -2.5e-94]], $MachinePrecision], Or[LessEqual[y, -2.4e-116], N[Not[LessEqual[y, 2.4e+92]], $MachinePrecision]]]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{+143} \lor \neg \left(y \leq -2.5 \cdot 10^{-94}\right) \land \left(y \leq -2.4 \cdot 10^{-116} \lor \neg \left(y \leq 2.4 \cdot 10^{+92}\right)\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if y < -1.22000000000000004e143 or -2.4999999999999998e-94 < y < -2.39999999999999993e-116 or 2.40000000000000005e92 < y Initial program 99.9%
Taylor expanded in y around inf 90.2%
Simplified90.2%
if -1.22000000000000004e143 < y < -2.4999999999999998e-94 or -2.39999999999999993e-116 < y < 2.40000000000000005e92Initial program 99.9%
Taylor expanded in y around 0 77.7%
Final simplification81.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.06e-116) (not (<= y 4.6e+26))) (+ (* 2.0 (* x (+ y z))) (* y 5.0)) (* x (+ t (* (+ y z) 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.06e-116) || !(y <= 4.6e+26)) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = x * (t + ((y + z) * 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 ((y <= (-1.06d-116)) .or. (.not. (y <= 4.6d+26))) then
tmp = (2.0d0 * (x * (y + z))) + (y * 5.0d0)
else
tmp = x * (t + ((y + z) * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.06e-116) || !(y <= 4.6e+26)) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = x * (t + ((y + z) * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.06e-116) or not (y <= 4.6e+26): tmp = (2.0 * (x * (y + z))) + (y * 5.0) else: tmp = x * (t + ((y + z) * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.06e-116) || !(y <= 4.6e+26)) tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(y * 5.0)); else tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.06e-116) || ~((y <= 4.6e+26))) tmp = (2.0 * (x * (y + z))) + (y * 5.0); else tmp = x * (t + ((y + z) * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.06e-116], N[Not[LessEqual[y, 4.6e+26]], $MachinePrecision]], N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{-116} \lor \neg \left(y \leq 4.6 \cdot 10^{+26}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\end{array}
\end{array}
if y < -1.05999999999999997e-116 or 4.6000000000000001e26 < y Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 89.1%
if -1.05999999999999997e-116 < y < 4.6000000000000001e26Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 87.9%
Final simplification88.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.09e+71)
(* x (+ t (* (+ y z) 2.0)))
(if (<= z 8.5e+83)
(+ (* x (+ t (+ y y))) (* y 5.0))
(+ (* 2.0 (* x (+ y z))) (* y 5.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.09e+71) {
tmp = x * (t + ((y + z) * 2.0));
} else if (z <= 8.5e+83) {
tmp = (x * (t + (y + y))) + (y * 5.0);
} else {
tmp = (2.0 * (x * (y + 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 (z <= (-1.09d+71)) then
tmp = x * (t + ((y + z) * 2.0d0))
else if (z <= 8.5d+83) then
tmp = (x * (t + (y + y))) + (y * 5.0d0)
else
tmp = (2.0d0 * (x * (y + 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 (z <= -1.09e+71) {
tmp = x * (t + ((y + z) * 2.0));
} else if (z <= 8.5e+83) {
tmp = (x * (t + (y + y))) + (y * 5.0);
} else {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.09e+71: tmp = x * (t + ((y + z) * 2.0)) elif z <= 8.5e+83: tmp = (x * (t + (y + y))) + (y * 5.0) else: tmp = (2.0 * (x * (y + z))) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.09e+71) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); elseif (z <= 8.5e+83) tmp = Float64(Float64(x * Float64(t + Float64(y + y))) + Float64(y * 5.0)); else tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.09e+71) tmp = x * (t + ((y + z) * 2.0)); elseif (z <= 8.5e+83) tmp = (x * (t + (y + y))) + (y * 5.0); else tmp = (2.0 * (x * (y + z))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.09e+71], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+83], N[(N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.09 \cdot 10^{+71}:\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+83}:\\
\;\;\;\;x \cdot \left(t + \left(y + y\right)\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\
\end{array}
\end{array}
if z < -1.09e71Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 88.0%
if -1.09e71 < z < 8.4999999999999995e83Initial program 99.9%
Taylor expanded in y around inf 91.4%
if 8.4999999999999995e83 < z Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 97.5%
Final simplification91.6%
(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
(let* ((t_1 (* 2.0 (* x z))))
(if (<= z -2.05e+71)
t_1
(if (<= z -2.1e+22)
(* y 5.0)
(if (<= z 8.2e+88) (* x (+ t (* y 2.0))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (z <= -2.05e+71) {
tmp = t_1;
} else if (z <= -2.1e+22) {
tmp = y * 5.0;
} else if (z <= 8.2e+88) {
tmp = x * (t + (y * 2.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 (z <= (-2.05d+71)) then
tmp = t_1
else if (z <= (-2.1d+22)) then
tmp = y * 5.0d0
else if (z <= 8.2d+88) then
tmp = x * (t + (y * 2.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 (z <= -2.05e+71) {
tmp = t_1;
} else if (z <= -2.1e+22) {
tmp = y * 5.0;
} else if (z <= 8.2e+88) {
tmp = x * (t + (y * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if z <= -2.05e+71: tmp = t_1 elif z <= -2.1e+22: tmp = y * 5.0 elif z <= 8.2e+88: tmp = x * (t + (y * 2.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 (z <= -2.05e+71) tmp = t_1; elseif (z <= -2.1e+22) tmp = Float64(y * 5.0); elseif (z <= 8.2e+88) tmp = Float64(x * Float64(t + Float64(y * 2.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 (z <= -2.05e+71) tmp = t_1; elseif (z <= -2.1e+22) tmp = y * 5.0; elseif (z <= 8.2e+88) tmp = x * (t + (y * 2.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[z, -2.05e+71], t$95$1, If[LessEqual[z, -2.1e+22], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, 8.2e+88], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{+22}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+88}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.0500000000000001e71 or 8.20000000000000055e88 < z Initial program 100.0%
Taylor expanded in z around inf 69.1%
if -2.0500000000000001e71 < z < -2.0999999999999998e22Initial program 99.9%
Taylor expanded in x around 0 64.7%
if -2.0999999999999998e22 < z < 8.20000000000000055e88Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 66.5%
Taylor expanded in z around 0 59.0%
Final simplification63.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.2e-14) (not (<= x 1.55e-48))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* 2.0 (* x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.2e-14) || !(x <= 1.55e-48)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (2.0 * (x * 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 <= (-2.2d-14)) .or. (.not. (x <= 1.55d-48))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.2e-14) || !(x <= 1.55e-48)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (2.0 * (x * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.2e-14) or not (x <= 1.55e-48): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (2.0 * (x * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.2e-14) || !(x <= 1.55e-48)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.2e-14) || ~((x <= 1.55e-48))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (2.0 * (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.2e-14], N[Not[LessEqual[x, 1.55e-48]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-14} \lor \neg \left(x \leq 1.55 \cdot 10^{-48}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if x < -2.2000000000000001e-14 or 1.55000000000000008e-48 < 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 98.6%
if -2.2000000000000001e-14 < x < 1.55000000000000008e-48Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 81.3%
Taylor expanded in y around 0 81.3%
Final simplification90.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.35e-15) (not (<= x 1.05e-53))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.35e-15) || !(x <= 1.05e-53)) {
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 <= (-1.35d-15)) .or. (.not. (x <= 1.05d-53))) 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 <= -1.35e-15) || !(x <= 1.05e-53)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.35e-15) or not (x <= 1.05e-53): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.35e-15) || !(x <= 1.05e-53)) 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 <= -1.35e-15) || ~((x <= 1.05e-53))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.35e-15], N[Not[LessEqual[x, 1.05e-53]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-15} \lor \neg \left(x \leq 1.05 \cdot 10^{-53}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -1.35000000000000005e-15 or 1.04999999999999989e-53 < x Initial program 100.0%
Taylor expanded in t around inf 38.8%
if -1.35000000000000005e-15 < x < 1.04999999999999989e-53Initial program 99.9%
Taylor expanded in x around 0 57.5%
Final simplification48.1%
(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 30.5%
Final simplification30.5%
herbie shell --seed 2023279
(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)))