
(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%
flip-+60.4%
associate-*r/56.7%
fma-neg57.7%
associate-+l+57.7%
+-commutative57.7%
count-257.7%
associate-+l+57.7%
+-commutative57.7%
count-257.7%
fma-neg56.7%
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-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 -4.2e-42)
t_1
(if (<= x 2.9e-102)
(* y 5.0)
(if (<= x 4.2e-38)
(* x t)
(if (<= x 2.16e+102)
t_1
(if (or (<= x 1.65e+253) (not (<= x 4.6e+288)))
(* x t)
(* x (* y 2.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -4.2e-42) {
tmp = t_1;
} else if (x <= 2.9e-102) {
tmp = y * 5.0;
} else if (x <= 4.2e-38) {
tmp = x * t;
} else if (x <= 2.16e+102) {
tmp = t_1;
} else if ((x <= 1.65e+253) || !(x <= 4.6e+288)) {
tmp = x * t;
} else {
tmp = x * (y * 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * z)
if (x <= (-4.2d-42)) then
tmp = t_1
else if (x <= 2.9d-102) then
tmp = y * 5.0d0
else if (x <= 4.2d-38) then
tmp = x * t
else if (x <= 2.16d+102) then
tmp = t_1
else if ((x <= 1.65d+253) .or. (.not. (x <= 4.6d+288))) then
tmp = x * t
else
tmp = x * (y * 2.0d0)
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 <= -4.2e-42) {
tmp = t_1;
} else if (x <= 2.9e-102) {
tmp = y * 5.0;
} else if (x <= 4.2e-38) {
tmp = x * t;
} else if (x <= 2.16e+102) {
tmp = t_1;
} else if ((x <= 1.65e+253) || !(x <= 4.6e+288)) {
tmp = x * t;
} else {
tmp = x * (y * 2.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if x <= -4.2e-42: tmp = t_1 elif x <= 2.9e-102: tmp = y * 5.0 elif x <= 4.2e-38: tmp = x * t elif x <= 2.16e+102: tmp = t_1 elif (x <= 1.65e+253) or not (x <= 4.6e+288): tmp = x * t else: tmp = x * (y * 2.0) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (x <= -4.2e-42) tmp = t_1; elseif (x <= 2.9e-102) tmp = Float64(y * 5.0); elseif (x <= 4.2e-38) tmp = Float64(x * t); elseif (x <= 2.16e+102) tmp = t_1; elseif ((x <= 1.65e+253) || !(x <= 4.6e+288)) tmp = Float64(x * t); else tmp = Float64(x * Float64(y * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (x <= -4.2e-42) tmp = t_1; elseif (x <= 2.9e-102) tmp = y * 5.0; elseif (x <= 4.2e-38) tmp = x * t; elseif (x <= 2.16e+102) tmp = t_1; elseif ((x <= 1.65e+253) || ~((x <= 4.6e+288))) tmp = x * t; else tmp = x * (y * 2.0); 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, -4.2e-42], t$95$1, If[LessEqual[x, 2.9e-102], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 4.2e-38], N[(x * t), $MachinePrecision], If[LessEqual[x, 2.16e+102], t$95$1, If[Or[LessEqual[x, 1.65e+253], N[Not[LessEqual[x, 4.6e+288]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-102}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-38}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.16 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+253} \lor \neg \left(x \leq 4.6 \cdot 10^{+288}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\end{array}
\end{array}
if x < -4.20000000000000013e-42 or 4.20000000000000026e-38 < x < 2.16000000000000005e102Initial program 100.0%
Taylor expanded in z around inf 50.7%
if -4.20000000000000013e-42 < x < 2.89999999999999986e-102Initial program 99.8%
Taylor expanded in x around 0 66.7%
if 2.89999999999999986e-102 < x < 4.20000000000000026e-38 or 2.16000000000000005e102 < x < 1.65e253 or 4.59999999999999987e288 < x Initial program 100.0%
Taylor expanded in t around inf 57.3%
if 1.65e253 < x < 4.59999999999999987e288Initial 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 85.8%
Final simplification59.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* 2.0 (* x z)))) (t_2 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -5.9e-33)
t_2
(if (<= x -1.65e-153)
t_1
(if (<= x -2e-287)
(+ (* y 5.0) (* x t))
(if (<= x 2.25e-101) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (2.0 * (x * z));
double t_2 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -5.9e-33) {
tmp = t_2;
} else if (x <= -1.65e-153) {
tmp = t_1;
} else if (x <= -2e-287) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 2.25e-101) {
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 = (y * 5.0d0) + (2.0d0 * (x * z))
t_2 = x * (t + ((y + z) * 2.0d0))
if (x <= (-5.9d-33)) then
tmp = t_2
else if (x <= (-1.65d-153)) then
tmp = t_1
else if (x <= (-2d-287)) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 2.25d-101) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (2.0 * (x * z));
double t_2 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -5.9e-33) {
tmp = t_2;
} else if (x <= -1.65e-153) {
tmp = t_1;
} else if (x <= -2e-287) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 2.25e-101) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 5.0) + (2.0 * (x * z)) t_2 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -5.9e-33: tmp = t_2 elif x <= -1.65e-153: tmp = t_1 elif x <= -2e-287: tmp = (y * 5.0) + (x * t) elif x <= 2.25e-101: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))) t_2 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -5.9e-33) tmp = t_2; elseif (x <= -1.65e-153) tmp = t_1; elseif (x <= -2e-287) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 2.25e-101) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * 5.0) + (2.0 * (x * z)); t_2 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -5.9e-33) tmp = t_2; elseif (x <= -1.65e-153) tmp = t_1; elseif (x <= -2e-287) tmp = (y * 5.0) + (x * t); elseif (x <= 2.25e-101) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.9e-33], t$95$2, If[LessEqual[x, -1.65e-153], t$95$1, If[LessEqual[x, -2e-287], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.25e-101], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
t_2 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -5.9 \cdot 10^{-33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-287}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-101}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -5.89999999999999985e-33 or 2.2499999999999999e-101 < 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 95.5%
if -5.89999999999999985e-33 < x < -1.64999999999999994e-153 or -2.00000000000000004e-287 < x < 2.2499999999999999e-101Initial program 99.8%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 88.8%
Taylor expanded in y around 0 88.8%
if -1.64999999999999994e-153 < x < -2.00000000000000004e-287Initial program 99.9%
+-commutative99.9%
fma-def100.0%
flip-+36.5%
associate-*r/36.4%
fma-neg36.8%
associate-+l+36.8%
+-commutative36.8%
count-236.8%
associate-+l+36.8%
+-commutative36.8%
count-236.8%
fma-neg36.4%
Applied egg-rr100.0%
Taylor expanded in t around inf 96.4%
*-commutative96.4%
Simplified96.4%
fma-udef96.4%
Applied egg-rr96.4%
Final simplification93.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* (+ y z) 2.0))))
(if (<= x -8e-42)
t_1
(if (<= x 2.1e-129)
(* y 5.0)
(if (or (<= x 4e-39) (not (<= x 8e+108))) (* x (+ t (* y 2.0))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y + z) * 2.0);
double tmp;
if (x <= -8e-42) {
tmp = t_1;
} else if (x <= 2.1e-129) {
tmp = y * 5.0;
} else if ((x <= 4e-39) || !(x <= 8e+108)) {
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 = x * ((y + z) * 2.0d0)
if (x <= (-8d-42)) then
tmp = t_1
else if (x <= 2.1d-129) then
tmp = y * 5.0d0
else if ((x <= 4d-39) .or. (.not. (x <= 8d+108))) 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 = x * ((y + z) * 2.0);
double tmp;
if (x <= -8e-42) {
tmp = t_1;
} else if (x <= 2.1e-129) {
tmp = y * 5.0;
} else if ((x <= 4e-39) || !(x <= 8e+108)) {
tmp = x * (t + (y * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y + z) * 2.0) tmp = 0 if x <= -8e-42: tmp = t_1 elif x <= 2.1e-129: tmp = y * 5.0 elif (x <= 4e-39) or not (x <= 8e+108): tmp = x * (t + (y * 2.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y + z) * 2.0)) tmp = 0.0 if (x <= -8e-42) tmp = t_1; elseif (x <= 2.1e-129) tmp = Float64(y * 5.0); elseif ((x <= 4e-39) || !(x <= 8e+108)) 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 = x * ((y + z) * 2.0); tmp = 0.0; if (x <= -8e-42) tmp = t_1; elseif (x <= 2.1e-129) tmp = y * 5.0; elseif ((x <= 4e-39) || ~((x <= 8e+108))) 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[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e-42], t$95$1, If[LessEqual[x, 2.1e-129], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 4e-39], N[Not[LessEqual[x, 8e+108]], $MachinePrecision]], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -8 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-129}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-39} \lor \neg \left(x \leq 8 \cdot 10^{+108}\right):\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -8.0000000000000003e-42 or 3.99999999999999972e-39 < x < 8.0000000000000003e108Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 94.8%
Taylor expanded in t around 0 75.2%
Simplified75.2%
if -8.0000000000000003e-42 < x < 2.1e-129Initial program 99.9%
Taylor expanded in x around 0 67.7%
if 2.1e-129 < x < 3.99999999999999972e-39 or 8.0000000000000003e108 < 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 95.4%
Taylor expanded in z around 0 72.6%
Final simplification71.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))))
(if (<= x -1.15e+36)
(* x (* (+ y z) 2.0))
(if (<= x -1.25e-42)
t_1
(if (<= x 1.72e-130)
(* y 5.0)
(if (<= x 6.5e+209) t_1 (* x (+ t (* y 2.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (x <= -1.15e+36) {
tmp = x * ((y + z) * 2.0);
} else if (x <= -1.25e-42) {
tmp = t_1;
} else if (x <= 1.72e-130) {
tmp = y * 5.0;
} else if (x <= 6.5e+209) {
tmp = t_1;
} else {
tmp = x * (t + (y * 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) :: t_1
real(8) :: tmp
t_1 = x * (t + (z * 2.0d0))
if (x <= (-1.15d+36)) then
tmp = x * ((y + z) * 2.0d0)
else if (x <= (-1.25d-42)) then
tmp = t_1
else if (x <= 1.72d-130) then
tmp = y * 5.0d0
else if (x <= 6.5d+209) then
tmp = t_1
else
tmp = x * (t + (y * 2.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 tmp;
if (x <= -1.15e+36) {
tmp = x * ((y + z) * 2.0);
} else if (x <= -1.25e-42) {
tmp = t_1;
} else if (x <= 1.72e-130) {
tmp = y * 5.0;
} else if (x <= 6.5e+209) {
tmp = t_1;
} else {
tmp = x * (t + (y * 2.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) tmp = 0 if x <= -1.15e+36: tmp = x * ((y + z) * 2.0) elif x <= -1.25e-42: tmp = t_1 elif x <= 1.72e-130: tmp = y * 5.0 elif x <= 6.5e+209: tmp = t_1 else: tmp = x * (t + (y * 2.0)) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) tmp = 0.0 if (x <= -1.15e+36) tmp = Float64(x * Float64(Float64(y + z) * 2.0)); elseif (x <= -1.25e-42) tmp = t_1; elseif (x <= 1.72e-130) tmp = Float64(y * 5.0); elseif (x <= 6.5e+209) tmp = t_1; else tmp = Float64(x * Float64(t + Float64(y * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); tmp = 0.0; if (x <= -1.15e+36) tmp = x * ((y + z) * 2.0); elseif (x <= -1.25e-42) tmp = t_1; elseif (x <= 1.72e-130) tmp = y * 5.0; elseif (x <= 6.5e+209) tmp = t_1; else tmp = x * (t + (y * 2.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]}, If[LessEqual[x, -1.15e+36], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.25e-42], t$95$1, If[LessEqual[x, 1.72e-130], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 6.5e+209], t$95$1, N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.72 \cdot 10^{-130}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+209}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if x < -1.14999999999999998e36Initial 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 t around 0 80.6%
Simplified80.6%
if -1.14999999999999998e36 < x < -1.25000000000000001e-42 or 1.72000000000000008e-130 < x < 6.49999999999999975e209Initial program 99.9%
Taylor expanded in y around 0 79.0%
if -1.25000000000000001e-42 < x < 1.72000000000000008e-130Initial program 99.9%
Taylor expanded in x around 0 67.7%
if 6.49999999999999975e209 < 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 94.9%
Final simplification75.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.9e+71) (not (<= z 8e-16))) (+ (* 2.0 (* x (+ y z))) (* y 5.0)) (+ (* y 5.0) (* x (+ t (+ y y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+71) || !(z <= 8e-16)) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = (y * 5.0) + (x * (t + (y + y)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.9d+71)) .or. (.not. (z <= 8d-16))) then
tmp = (2.0d0 * (x * (y + z))) + (y * 5.0d0)
else
tmp = (y * 5.0d0) + (x * (t + (y + y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+71) || !(z <= 8e-16)) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = (y * 5.0) + (x * (t + (y + y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.9e+71) or not (z <= 8e-16): tmp = (2.0 * (x * (y + z))) + (y * 5.0) else: tmp = (y * 5.0) + (x * (t + (y + y))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.9e+71) || !(z <= 8e-16)) tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(y * 5.0)); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.9e+71) || ~((z <= 8e-16))) tmp = (2.0 * (x * (y + z))) + (y * 5.0); else tmp = (y * 5.0) + (x * (t + (y + y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.9e+71], N[Not[LessEqual[z, 8e-16]], $MachinePrecision]], N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+71} \lor \neg \left(z \leq 8 \cdot 10^{-16}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + y\right)\right)\\
\end{array}
\end{array}
if z < -2.90000000000000007e71 or 7.9999999999999998e-16 < z 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 -2.90000000000000007e71 < z < 7.9999999999999998e-16Initial program 99.9%
Taylor expanded in y around inf 95.6%
Final simplification92.5%
(FPCore (x y z t)
:precision binary64
(if (<= t -4.8e-26)
(* x (+ t (* (+ y z) 2.0)))
(if (<= t 9.6e-23)
(+ (* 2.0 (* x (+ y z))) (* y 5.0))
(+ (* y 5.0) (* x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.8e-26) {
tmp = x * (t + ((y + z) * 2.0));
} else if (t <= 9.6e-23) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} 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 (t <= (-4.8d-26)) then
tmp = x * (t + ((y + z) * 2.0d0))
else if (t <= 9.6d-23) then
tmp = (2.0d0 * (x * (y + z))) + (y * 5.0d0)
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 (t <= -4.8e-26) {
tmp = x * (t + ((y + z) * 2.0));
} else if (t <= 9.6e-23) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.8e-26: tmp = x * (t + ((y + z) * 2.0)) elif t <= 9.6e-23: tmp = (2.0 * (x * (y + z))) + (y * 5.0) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.8e-26) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); elseif (t <= 9.6e-23) tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(y * 5.0)); 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 (t <= -4.8e-26) tmp = x * (t + ((y + z) * 2.0)); elseif (t <= 9.6e-23) tmp = (2.0 * (x * (y + z))) + (y * 5.0); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.8e-26], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.6e-23], N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{-26}:\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{-23}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if t < -4.8000000000000002e-26Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 85.9%
if -4.8000000000000002e-26 < t < 9.59999999999999986e-23Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 97.2%
if 9.59999999999999986e-23 < t Initial program 99.9%
+-commutative99.9%
fma-def100.0%
flip-+50.1%
associate-*r/46.7%
fma-neg49.1%
associate-+l+49.1%
+-commutative49.1%
count-249.1%
associate-+l+49.1%
+-commutative49.1%
count-249.1%
fma-neg46.7%
Applied egg-rr100.0%
Taylor expanded in t around inf 80.2%
*-commutative80.2%
Simplified80.2%
fma-udef80.2%
Applied egg-rr80.2%
Final simplification90.8%
(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 (<= x -2.1e-42)
t_1
(if (<= x 2.25e-101)
(* y 5.0)
(if (or (<= x 8e-36) (not (<= x 4.15e+102))) (* x t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -2.1e-42) {
tmp = t_1;
} else if (x <= 2.25e-101) {
tmp = y * 5.0;
} else if ((x <= 8e-36) || !(x <= 4.15e+102)) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * z)
if (x <= (-2.1d-42)) then
tmp = t_1
else if (x <= 2.25d-101) then
tmp = y * 5.0d0
else if ((x <= 8d-36) .or. (.not. (x <= 4.15d+102))) then
tmp = x * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -2.1e-42) {
tmp = t_1;
} else if (x <= 2.25e-101) {
tmp = y * 5.0;
} else if ((x <= 8e-36) || !(x <= 4.15e+102)) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if x <= -2.1e-42: tmp = t_1 elif x <= 2.25e-101: tmp = y * 5.0 elif (x <= 8e-36) or not (x <= 4.15e+102): tmp = x * t 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.1e-42) tmp = t_1; elseif (x <= 2.25e-101) tmp = Float64(y * 5.0); elseif ((x <= 8e-36) || !(x <= 4.15e+102)) tmp = Float64(x * t); 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.1e-42) tmp = t_1; elseif (x <= 2.25e-101) tmp = y * 5.0; elseif ((x <= 8e-36) || ~((x <= 4.15e+102))) tmp = x * t; 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.1e-42], t$95$1, If[LessEqual[x, 2.25e-101], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 8e-36], N[Not[LessEqual[x, 4.15e+102]], $MachinePrecision]], N[(x * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-101}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-36} \lor \neg \left(x \leq 4.15 \cdot 10^{+102}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.10000000000000006e-42 or 7.9999999999999995e-36 < x < 4.1500000000000002e102Initial program 100.0%
Taylor expanded in z around inf 50.7%
if -2.10000000000000006e-42 < x < 2.2499999999999999e-101Initial program 99.8%
Taylor expanded in x around 0 66.7%
if 2.2499999999999999e-101 < x < 7.9999999999999995e-36 or 4.1500000000000002e102 < x Initial program 100.0%
Taylor expanded in t around inf 52.3%
Final simplification57.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* (+ y z) 2.0))))
(if (<= x -8e-42)
t_1
(if (<= x 5.8e-105) (* y 5.0) (if (<= x 7e-37) (* x t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y + z) * 2.0);
double tmp;
if (x <= -8e-42) {
tmp = t_1;
} else if (x <= 5.8e-105) {
tmp = y * 5.0;
} else if (x <= 7e-37) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((y + z) * 2.0d0)
if (x <= (-8d-42)) then
tmp = t_1
else if (x <= 5.8d-105) then
tmp = y * 5.0d0
else if (x <= 7d-37) then
tmp = x * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y + z) * 2.0);
double tmp;
if (x <= -8e-42) {
tmp = t_1;
} else if (x <= 5.8e-105) {
tmp = y * 5.0;
} else if (x <= 7e-37) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y + z) * 2.0) tmp = 0 if x <= -8e-42: tmp = t_1 elif x <= 5.8e-105: tmp = y * 5.0 elif x <= 7e-37: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y + z) * 2.0)) tmp = 0.0 if (x <= -8e-42) tmp = t_1; elseif (x <= 5.8e-105) tmp = Float64(y * 5.0); elseif (x <= 7e-37) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y + z) * 2.0); tmp = 0.0; if (x <= -8e-42) tmp = t_1; elseif (x <= 5.8e-105) tmp = y * 5.0; elseif (x <= 7e-37) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e-42], t$95$1, If[LessEqual[x, 5.8e-105], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 7e-37], N[(x * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -8 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-105}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-37}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -8.0000000000000003e-42 or 7.0000000000000003e-37 < 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.3%
Taylor expanded in t around 0 69.9%
Simplified69.9%
if -8.0000000000000003e-42 < x < 5.80000000000000007e-105Initial program 99.8%
Taylor expanded in x around 0 66.7%
if 5.80000000000000007e-105 < x < 7.0000000000000003e-37Initial program 100.0%
Taylor expanded in t around inf 65.6%
Final simplification68.3%
(FPCore (x y z t)
:precision binary64
(if (<= x -4.2e-11)
(* x (* (+ y z) 2.0))
(if (<= x 1.2e-129)
(+ (* y 5.0) (* x t))
(if (<= x 1.7e+209) (* x (+ t (* z 2.0))) (* x (+ t (* y 2.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.2e-11) {
tmp = x * ((y + z) * 2.0);
} else if (x <= 1.2e-129) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 1.7e+209) {
tmp = x * (t + (z * 2.0));
} else {
tmp = x * (t + (y * 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 <= (-4.2d-11)) then
tmp = x * ((y + z) * 2.0d0)
else if (x <= 1.2d-129) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 1.7d+209) then
tmp = x * (t + (z * 2.0d0))
else
tmp = x * (t + (y * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.2e-11) {
tmp = x * ((y + z) * 2.0);
} else if (x <= 1.2e-129) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 1.7e+209) {
tmp = x * (t + (z * 2.0));
} else {
tmp = x * (t + (y * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.2e-11: tmp = x * ((y + z) * 2.0) elif x <= 1.2e-129: tmp = (y * 5.0) + (x * t) elif x <= 1.7e+209: tmp = x * (t + (z * 2.0)) else: tmp = x * (t + (y * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.2e-11) tmp = Float64(x * Float64(Float64(y + z) * 2.0)); elseif (x <= 1.2e-129) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 1.7e+209) tmp = Float64(x * Float64(t + Float64(z * 2.0))); else tmp = Float64(x * Float64(t + Float64(y * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.2e-11) tmp = x * ((y + z) * 2.0); elseif (x <= 1.2e-129) tmp = (y * 5.0) + (x * t); elseif (x <= 1.7e+209) tmp = x * (t + (z * 2.0)); else tmp = x * (t + (y * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.2e-11], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.2e-129], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7e+209], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-129}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+209}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if x < -4.1999999999999997e-11Initial 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 t around 0 80.4%
Simplified80.4%
if -4.1999999999999997e-11 < x < 1.19999999999999994e-129Initial program 99.9%
+-commutative99.9%
fma-def100.0%
flip-+46.3%
associate-*r/46.2%
fma-neg46.5%
associate-+l+46.5%
+-commutative46.5%
count-246.5%
associate-+l+46.5%
+-commutative46.5%
count-246.5%
fma-neg46.2%
Applied egg-rr100.0%
Taylor expanded in t around inf 81.6%
*-commutative81.6%
Simplified81.6%
fma-udef81.5%
Applied egg-rr81.5%
if 1.19999999999999994e-129 < x < 1.6999999999999998e209Initial program 99.9%
Taylor expanded in y around 0 76.8%
if 1.6999999999999998e209 < 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 94.9%
Final simplification80.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.4e-42) (not (<= x 3.2e-129))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.4e-42) || !(x <= 3.2e-129)) {
tmp = x * (t + ((y + z) * 2.0));
} 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.4d-42)) .or. (.not. (x <= 3.2d-129))) then
tmp = x * (t + ((y + z) * 2.0d0))
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.4e-42) || !(x <= 3.2e-129)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.4e-42) or not (x <= 3.2e-129): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.4e-42) || !(x <= 3.2e-129)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); 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.4e-42) || ~((x <= 3.2e-129))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.4e-42], N[Not[LessEqual[x, 3.2e-129]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $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.4 \cdot 10^{-42} \lor \neg \left(x \leq 3.2 \cdot 10^{-129}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -1.39999999999999999e-42 or 3.2000000000000003e-129 < 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 95.0%
if -1.39999999999999999e-42 < x < 3.2000000000000003e-129Initial program 99.9%
+-commutative99.9%
fma-def100.0%
flip-+45.9%
associate-*r/45.9%
fma-neg46.2%
associate-+l+46.2%
+-commutative46.2%
count-246.2%
associate-+l+46.2%
+-commutative46.2%
count-246.2%
fma-neg45.9%
Applied egg-rr100.0%
Taylor expanded in t around inf 82.6%
*-commutative82.6%
Simplified82.6%
fma-udef82.6%
Applied egg-rr82.6%
Final simplification90.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.2e-33) (not (<= y 3.4e+34))) (* 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 <= -4.2e-33) || !(y <= 3.4e+34)) {
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 <= (-4.2d-33)) .or. (.not. (y <= 3.4d+34))) 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 <= -4.2e-33) || !(y <= 3.4e+34)) {
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 <= -4.2e-33) or not (y <= 3.4e+34): 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 <= -4.2e-33) || !(y <= 3.4e+34)) 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 <= -4.2e-33) || ~((y <= 3.4e+34))) 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, -4.2e-33], N[Not[LessEqual[y, 3.4e+34]], $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 -4.2 \cdot 10^{-33} \lor \neg \left(y \leq 3.4 \cdot 10^{+34}\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 < -4.2e-33 or 3.3999999999999999e34 < y Initial program 99.9%
Taylor expanded in y around inf 75.7%
Simplified75.7%
if -4.2e-33 < y < 3.3999999999999999e34Initial program 100.0%
Taylor expanded in y around 0 84.2%
Final simplification79.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3e-32) (not (<= x 2.25e-101))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3e-32) || !(x <= 2.25e-101)) {
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 <= (-3d-32)) .or. (.not. (x <= 2.25d-101))) 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 <= -3e-32) || !(x <= 2.25e-101)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3e-32) or not (x <= 2.25e-101): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3e-32) || !(x <= 2.25e-101)) 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 <= -3e-32) || ~((x <= 2.25e-101))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3e-32], N[Not[LessEqual[x, 2.25e-101]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{-32} \lor \neg \left(x \leq 2.25 \cdot 10^{-101}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -3e-32 or 2.2499999999999999e-101 < x Initial program 100.0%
Taylor expanded in t around inf 35.1%
if -3e-32 < x < 2.2499999999999999e-101Initial program 99.9%
Taylor expanded in x around 0 66.1%
Final simplification47.8%
(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 29.9%
Final simplification29.9%
herbie shell --seed 2023334
(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)))