
(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 100.0%
+-commutative100.0%
fma-def100.0%
flip-+58.7%
associate-*r/53.9%
fma-neg56.8%
associate-+l+56.8%
+-commutative56.8%
count-256.8%
associate-+l+56.8%
+-commutative56.8%
count-256.8%
fma-neg53.9%
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 100.0%
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 (* 2.0 (* x z))) (t_2 (* x (+ t (* y 2.0)))))
(if (<= x -6.8e+42)
t_2
(if (<= x -5.8e-24)
t_1
(if (<= x -9.5e-45)
(* x t)
(if (<= x 2.15e-80) (* y 5.0) (if (<= x 8.2e+38) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double t_2 = x * (t + (y * 2.0));
double tmp;
if (x <= -6.8e+42) {
tmp = t_2;
} else if (x <= -5.8e-24) {
tmp = t_1;
} else if (x <= -9.5e-45) {
tmp = x * t;
} else if (x <= 2.15e-80) {
tmp = y * 5.0;
} else if (x <= 8.2e+38) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (x * z)
t_2 = x * (t + (y * 2.0d0))
if (x <= (-6.8d+42)) then
tmp = t_2
else if (x <= (-5.8d-24)) then
tmp = t_1
else if (x <= (-9.5d-45)) then
tmp = x * t
else if (x <= 2.15d-80) then
tmp = y * 5.0d0
else if (x <= 8.2d+38) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double t_2 = x * (t + (y * 2.0));
double tmp;
if (x <= -6.8e+42) {
tmp = t_2;
} else if (x <= -5.8e-24) {
tmp = t_1;
} else if (x <= -9.5e-45) {
tmp = x * t;
} else if (x <= 2.15e-80) {
tmp = y * 5.0;
} else if (x <= 8.2e+38) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) t_2 = x * (t + (y * 2.0)) tmp = 0 if x <= -6.8e+42: tmp = t_2 elif x <= -5.8e-24: tmp = t_1 elif x <= -9.5e-45: tmp = x * t elif x <= 2.15e-80: tmp = y * 5.0 elif x <= 8.2e+38: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) t_2 = Float64(x * Float64(t + Float64(y * 2.0))) tmp = 0.0 if (x <= -6.8e+42) tmp = t_2; elseif (x <= -5.8e-24) tmp = t_1; elseif (x <= -9.5e-45) tmp = Float64(x * t); elseif (x <= 2.15e-80) tmp = Float64(y * 5.0); elseif (x <= 8.2e+38) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); t_2 = x * (t + (y * 2.0)); tmp = 0.0; if (x <= -6.8e+42) tmp = t_2; elseif (x <= -5.8e-24) tmp = t_1; elseif (x <= -9.5e-45) tmp = x * t; elseif (x <= 2.15e-80) tmp = y * 5.0; elseif (x <= 8.2e+38) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.8e+42], t$95$2, If[LessEqual[x, -5.8e-24], t$95$1, If[LessEqual[x, -9.5e-45], N[(x * t), $MachinePrecision], If[LessEqual[x, 2.15e-80], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 8.2e+38], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
t_2 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -6.8 \cdot 10^{+42}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-45}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-80}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -6.7999999999999995e42 or 8.2000000000000007e38 < x Initial program 100.0%
Taylor expanded in y around inf 79.4%
Taylor expanded in x around inf 79.4%
if -6.7999999999999995e42 < x < -5.7999999999999997e-24 or 2.1500000000000001e-80 < x < 8.2000000000000007e38Initial program 99.9%
Taylor expanded in z around inf 60.9%
if -5.7999999999999997e-24 < x < -9.5000000000000002e-45Initial program 100.0%
Taylor expanded in t around inf 53.1%
if -9.5000000000000002e-45 < x < 2.1500000000000001e-80Initial program 99.9%
Taylor expanded in x around 0 71.3%
Final simplification72.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -230.0) (not (<= x 2.4e-18))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (+ (* x (* z 2.0)) (* x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -230.0) || !(x <= 2.4e-18)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + ((x * (z * 2.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 <= (-230.0d0)) .or. (.not. (x <= 2.4d-18))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + ((x * (z * 2.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 <= -230.0) || !(x <= 2.4e-18)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + ((x * (z * 2.0)) + (x * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -230.0) or not (x <= 2.4e-18): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + ((x * (z * 2.0)) + (x * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -230.0) || !(x <= 2.4e-18)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(Float64(x * Float64(z * 2.0)) + Float64(x * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -230.0) || ~((x <= 2.4e-18))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + ((x * (z * 2.0)) + (x * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -230.0], N[Not[LessEqual[x, 2.4e-18]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -230 \lor \neg \left(x \leq 2.4 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + \left(x \cdot \left(z \cdot 2\right) + x \cdot t\right)\\
\end{array}
\end{array}
if x < -230 or 2.39999999999999994e-18 < 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.9%
if -230 < x < 2.39999999999999994e-18Initial program 99.9%
Taylor expanded in y around 0 99.2%
distribute-lft-in99.2%
*-commutative99.2%
Applied egg-rr99.2%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (+ y z) 2.0)))
(if (<= x 4000000000000.0)
(+ (* x t_1) (+ (* y 5.0) (* x t)))
(* x (+ t t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y + z) * 2.0;
double tmp;
if (x <= 4000000000000.0) {
tmp = (x * t_1) + ((y * 5.0) + (x * t));
} else {
tmp = x * (t + t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y + z) * 2.0d0
if (x <= 4000000000000.0d0) then
tmp = (x * t_1) + ((y * 5.0d0) + (x * t))
else
tmp = x * (t + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y + z) * 2.0;
double tmp;
if (x <= 4000000000000.0) {
tmp = (x * t_1) + ((y * 5.0) + (x * t));
} else {
tmp = x * (t + t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y + z) * 2.0 tmp = 0 if x <= 4000000000000.0: tmp = (x * t_1) + ((y * 5.0) + (x * t)) else: tmp = x * (t + t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y + z) * 2.0) tmp = 0.0 if (x <= 4000000000000.0) tmp = Float64(Float64(x * t_1) + Float64(Float64(y * 5.0) + Float64(x * t))); else tmp = Float64(x * Float64(t + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y + z) * 2.0; tmp = 0.0; if (x <= 4000000000000.0) tmp = (x * t_1) + ((y * 5.0) + (x * t)); else tmp = x * (t + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[x, 4000000000000.0], N[(N[(x * t$95$1), $MachinePrecision] + N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + z\right) \cdot 2\\
\mathbf{if}\;x \leq 4000000000000:\\
\;\;\;\;x \cdot t_1 + \left(y \cdot 5 + x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + t_1\right)\\
\end{array}
\end{array}
if x < 4e12Initial program 99.9%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
fma-udef99.9%
Applied egg-rr98.0%
if 4e12 < 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%
Final simplification98.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -1.46e+47)
(* x t)
(if (<= x -2.7e-28)
t_1
(if (<= x 2.2e-80)
(* y 5.0)
(if (or (<= x 3e+46) (not (<= x 1.04e+290))) 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.46e+47) {
tmp = x * t;
} else if (x <= -2.7e-28) {
tmp = t_1;
} else if (x <= 2.2e-80) {
tmp = y * 5.0;
} else if ((x <= 3e+46) || !(x <= 1.04e+290)) {
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.46d+47)) then
tmp = x * t
else if (x <= (-2.7d-28)) then
tmp = t_1
else if (x <= 2.2d-80) then
tmp = y * 5.0d0
else if ((x <= 3d+46) .or. (.not. (x <= 1.04d+290))) 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.46e+47) {
tmp = x * t;
} else if (x <= -2.7e-28) {
tmp = t_1;
} else if (x <= 2.2e-80) {
tmp = y * 5.0;
} else if ((x <= 3e+46) || !(x <= 1.04e+290)) {
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.46e+47: tmp = x * t elif x <= -2.7e-28: tmp = t_1 elif x <= 2.2e-80: tmp = y * 5.0 elif (x <= 3e+46) or not (x <= 1.04e+290): 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.46e+47) tmp = Float64(x * t); elseif (x <= -2.7e-28) tmp = t_1; elseif (x <= 2.2e-80) tmp = Float64(y * 5.0); elseif ((x <= 3e+46) || !(x <= 1.04e+290)) 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.46e+47) tmp = x * t; elseif (x <= -2.7e-28) tmp = t_1; elseif (x <= 2.2e-80) tmp = y * 5.0; elseif ((x <= 3e+46) || ~((x <= 1.04e+290))) 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.46e+47], N[(x * t), $MachinePrecision], If[LessEqual[x, -2.7e-28], t$95$1, If[LessEqual[x, 2.2e-80], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 3e+46], N[Not[LessEqual[x, 1.04e+290]], $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.46 \cdot 10^{+47}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-80}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+46} \lor \neg \left(x \leq 1.04 \cdot 10^{+290}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -1.46000000000000006e47 or 3.00000000000000023e46 < x < 1.04000000000000003e290Initial program 100.0%
Taylor expanded in t around inf 49.3%
if -1.46000000000000006e47 < x < -2.6999999999999999e-28 or 2.2000000000000001e-80 < x < 3.00000000000000023e46 or 1.04000000000000003e290 < x Initial program 99.9%
Taylor expanded in z around inf 60.5%
if -2.6999999999999999e-28 < x < 2.2000000000000001e-80Initial program 99.9%
Taylor expanded in x around 0 69.3%
Final simplification59.9%
(FPCore (x y z t)
:precision binary64
(if (or (<= y -1.55e+109)
(not
(or (<= y -8.8e+87) (and (not (<= y -1.08e-45)) (<= y 1.6e+72)))))
(* 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.55e+109) || !((y <= -8.8e+87) || (!(y <= -1.08e-45) && (y <= 1.6e+72)))) {
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.55d+109)) .or. (.not. (y <= (-8.8d+87)) .or. (.not. (y <= (-1.08d-45))) .and. (y <= 1.6d+72))) 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.55e+109) || !((y <= -8.8e+87) || (!(y <= -1.08e-45) && (y <= 1.6e+72)))) {
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.55e+109) or not ((y <= -8.8e+87) or (not (y <= -1.08e-45) and (y <= 1.6e+72))): 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.55e+109) || !((y <= -8.8e+87) || (!(y <= -1.08e-45) && (y <= 1.6e+72)))) 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.55e+109) || ~(((y <= -8.8e+87) || (~((y <= -1.08e-45)) && (y <= 1.6e+72))))) 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.55e+109], N[Not[Or[LessEqual[y, -8.8e+87], And[N[Not[LessEqual[y, -1.08e-45]], $MachinePrecision], LessEqual[y, 1.6e+72]]]], $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.55 \cdot 10^{+109} \lor \neg \left(y \leq -8.8 \cdot 10^{+87} \lor \neg \left(y \leq -1.08 \cdot 10^{-45}\right) \land y \leq 1.6 \cdot 10^{+72}\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.54999999999999996e109 or -8.8000000000000003e87 < y < -1.08e-45 or 1.6000000000000001e72 < y Initial program 99.9%
Taylor expanded in y around inf 81.4%
Simplified81.4%
if -1.54999999999999996e109 < y < -8.8000000000000003e87 or -1.08e-45 < y < 1.6000000000000001e72Initial program 100.0%
Taylor expanded in y around 0 79.9%
Final simplification80.6%
(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.7e+43)
t_2
(if (<= x -3.5e-49)
t_1
(if (<= x 6.8e-85) (* y 5.0) (if (<= x 1.45e+186) 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 = x * (t + (y * 2.0));
double tmp;
if (x <= -3.7e+43) {
tmp = t_2;
} else if (x <= -3.5e-49) {
tmp = t_1;
} else if (x <= 6.8e-85) {
tmp = y * 5.0;
} else if (x <= 1.45e+186) {
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 = x * (t + (y * 2.0d0))
if (x <= (-3.7d+43)) then
tmp = t_2
else if (x <= (-3.5d-49)) then
tmp = t_1
else if (x <= 6.8d-85) then
tmp = y * 5.0d0
else if (x <= 1.45d+186) 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 = x * (t + (y * 2.0));
double tmp;
if (x <= -3.7e+43) {
tmp = t_2;
} else if (x <= -3.5e-49) {
tmp = t_1;
} else if (x <= 6.8e-85) {
tmp = y * 5.0;
} else if (x <= 1.45e+186) {
tmp = t_1;
} else {
tmp = t_2;
}
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.7e+43: tmp = t_2 elif x <= -3.5e-49: tmp = t_1 elif x <= 6.8e-85: tmp = y * 5.0 elif x <= 1.45e+186: 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(x * Float64(t + Float64(y * 2.0))) tmp = 0.0 if (x <= -3.7e+43) tmp = t_2; elseif (x <= -3.5e-49) tmp = t_1; elseif (x <= 6.8e-85) tmp = Float64(y * 5.0); elseif (x <= 1.45e+186) 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 = x * (t + (y * 2.0)); tmp = 0.0; if (x <= -3.7e+43) tmp = t_2; elseif (x <= -3.5e-49) tmp = t_1; elseif (x <= 6.8e-85) tmp = y * 5.0; elseif (x <= 1.45e+186) 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[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.7e+43], t$95$2, If[LessEqual[x, -3.5e-49], t$95$1, If[LessEqual[x, 6.8e-85], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.45e+186], t$95$1, t$95$2]]]]]]
\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.7 \cdot 10^{+43}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-85}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+186}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -3.7000000000000001e43 or 1.45e186 < x Initial program 100.0%
Taylor expanded in y around inf 83.5%
Taylor expanded in x around inf 83.5%
if -3.7000000000000001e43 < x < -3.50000000000000006e-49 or 6.8e-85 < x < 1.45e186Initial program 99.9%
Taylor expanded in y around 0 75.6%
if -3.50000000000000006e-49 < x < 6.8e-85Initial program 99.9%
Taylor expanded in x around 0 72.3%
Final simplification77.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* x (+ t (* y 2.0)))))
(if (<= x -1.75e+44)
t_2
(if (<= x -1.65e-28)
t_1
(if (<= x 2.2e-80)
(+ (* y 5.0) (* x t))
(if (<= x 1.55e+186) 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 = x * (t + (y * 2.0));
double tmp;
if (x <= -1.75e+44) {
tmp = t_2;
} else if (x <= -1.65e-28) {
tmp = t_1;
} else if (x <= 2.2e-80) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 1.55e+186) {
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 = x * (t + (y * 2.0d0))
if (x <= (-1.75d+44)) then
tmp = t_2
else if (x <= (-1.65d-28)) then
tmp = t_1
else if (x <= 2.2d-80) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 1.55d+186) 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 = x * (t + (y * 2.0));
double tmp;
if (x <= -1.75e+44) {
tmp = t_2;
} else if (x <= -1.65e-28) {
tmp = t_1;
} else if (x <= 2.2e-80) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 1.55e+186) {
tmp = t_1;
} else {
tmp = t_2;
}
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 <= -1.75e+44: tmp = t_2 elif x <= -1.65e-28: tmp = t_1 elif x <= 2.2e-80: tmp = (y * 5.0) + (x * t) elif x <= 1.55e+186: 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(x * Float64(t + Float64(y * 2.0))) tmp = 0.0 if (x <= -1.75e+44) tmp = t_2; elseif (x <= -1.65e-28) tmp = t_1; elseif (x <= 2.2e-80) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 1.55e+186) 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 = x * (t + (y * 2.0)); tmp = 0.0; if (x <= -1.75e+44) tmp = t_2; elseif (x <= -1.65e-28) tmp = t_1; elseif (x <= 2.2e-80) tmp = (y * 5.0) + (x * t); elseif (x <= 1.55e+186) 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[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75e+44], t$95$2, If[LessEqual[x, -1.65e-28], t$95$1, If[LessEqual[x, 2.2e-80], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.55e+186], t$95$1, t$95$2]]]]]]
\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 -1.75 \cdot 10^{+44}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-80}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+186}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.75e44 or 1.5500000000000001e186 < x Initial program 100.0%
Taylor expanded in y around inf 83.5%
Taylor expanded in x around inf 83.5%
if -1.75e44 < x < -1.6500000000000001e-28 or 2.2000000000000001e-80 < x < 1.5500000000000001e186Initial program 99.9%
Taylor expanded in y around 0 76.9%
if -1.6500000000000001e-28 < x < 2.2000000000000001e-80Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around 0 85.5%
Final simplification82.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -2.9e-28)
t_1
(if (<= x -1.2e-163)
(+ (* y 5.0) (* x t))
(if (<= x 2.6e-59) (+ (* y 5.0) (* 2.0 (* x z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -2.9e-28) {
tmp = t_1;
} else if (x <= -1.2e-163) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 2.6e-59) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + ((y + z) * 2.0d0))
if (x <= (-2.9d-28)) then
tmp = t_1
else if (x <= (-1.2d-163)) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 2.6d-59) then
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -2.9e-28) {
tmp = t_1;
} else if (x <= -1.2e-163) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 2.6e-59) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -2.9e-28: tmp = t_1 elif x <= -1.2e-163: tmp = (y * 5.0) + (x * t) elif x <= 2.6e-59: tmp = (y * 5.0) + (2.0 * (x * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -2.9e-28) tmp = t_1; elseif (x <= -1.2e-163) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 2.6e-59) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -2.9e-28) tmp = t_1; elseif (x <= -1.2e-163) tmp = (y * 5.0) + (x * t); elseif (x <= 2.6e-59) tmp = (y * 5.0) + (2.0 * (x * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.9e-28], t$95$1, If[LessEqual[x, -1.2e-163], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e-59], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-163}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-59}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.90000000000000013e-28 or 2.59999999999999998e-59 < 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%
if -2.90000000000000013e-28 < x < -1.2e-163Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around 0 94.8%
if -1.2e-163 < x < 2.59999999999999998e-59Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in t around 0 87.8%
Final simplification93.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -14.5)
t_1
(if (<= x -2.75e-163)
(+ (* x t) (* y (+ 5.0 (* x 2.0))))
(if (<= x 6.6e-59) (+ (* y 5.0) (* 2.0 (* x z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -14.5) {
tmp = t_1;
} else if (x <= -2.75e-163) {
tmp = (x * t) + (y * (5.0 + (x * 2.0)));
} else if (x <= 6.6e-59) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + ((y + z) * 2.0d0))
if (x <= (-14.5d0)) then
tmp = t_1
else if (x <= (-2.75d-163)) then
tmp = (x * t) + (y * (5.0d0 + (x * 2.0d0)))
else if (x <= 6.6d-59) then
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -14.5) {
tmp = t_1;
} else if (x <= -2.75e-163) {
tmp = (x * t) + (y * (5.0 + (x * 2.0)));
} else if (x <= 6.6e-59) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -14.5: tmp = t_1 elif x <= -2.75e-163: tmp = (x * t) + (y * (5.0 + (x * 2.0))) elif x <= 6.6e-59: tmp = (y * 5.0) + (2.0 * (x * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -14.5) tmp = t_1; elseif (x <= -2.75e-163) tmp = Float64(Float64(x * t) + Float64(y * Float64(5.0 + Float64(x * 2.0)))); elseif (x <= 6.6e-59) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -14.5) tmp = t_1; elseif (x <= -2.75e-163) tmp = (x * t) + (y * (5.0 + (x * 2.0))); elseif (x <= 6.6e-59) tmp = (y * 5.0) + (2.0 * (x * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -14.5], t$95$1, If[LessEqual[x, -2.75e-163], N[(N[(x * t), $MachinePrecision] + N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.6e-59], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -14.5:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.75 \cdot 10^{-163}:\\
\;\;\;\;x \cdot t + y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-59}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -14.5 or 6.59999999999999964e-59 < 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 97.6%
if -14.5 < x < -2.7499999999999999e-163Initial program 99.9%
Taylor expanded in y around inf 90.8%
Taylor expanded in y around 0 90.8%
if -2.7499999999999999e-163 < x < 6.59999999999999964e-59Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in t around 0 87.8%
Final simplification93.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -230.0) (not (<= x 2.4e-18))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* x (+ t (* z 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -230.0) || !(x <= 2.4e-18)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (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 ((x <= (-230.0d0)) .or. (.not. (x <= 2.4d-18))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + (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 ((x <= -230.0) || !(x <= 2.4e-18)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * (t + (z * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -230.0) or not (x <= 2.4e-18): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (x * (t + (z * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -230.0) || !(x <= 2.4e-18)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(z * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -230.0) || ~((x <= 2.4e-18))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (x * (t + (z * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -230.0], N[Not[LessEqual[x, 2.4e-18]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -230 \lor \neg \left(x \leq 2.4 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if x < -230 or 2.39999999999999994e-18 < 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.9%
if -230 < x < 2.39999999999999994e-18Initial program 99.9%
Taylor expanded in y around 0 99.2%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (+ (* y 5.0) (* x (+ t (+ y (+ z (+ y z)))))))
double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (z + (y + z)))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * 5.0d0) + (x * (t + (y + (z + (y + z)))))
end function
public static double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (z + (y + z)))));
}
def code(x, y, z, t): return (y * 5.0) + (x * (t + (y + (z + (y + z)))))
function code(x, y, z, t) return Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z)))))) end
function tmp = code(x, y, z, t) tmp = (y * 5.0) + (x * (t + (y + (z + (y + z))))); end
code[x_, y_, z_, t_] := N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5 + x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.8e-29) (not (<= x 2.2e-80))) (* 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 <= -2.8e-29) || !(x <= 2.2e-80)) {
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 <= (-2.8d-29)) .or. (.not. (x <= 2.2d-80))) 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 <= -2.8e-29) || !(x <= 2.2e-80)) {
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 <= -2.8e-29) or not (x <= 2.2e-80): 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 <= -2.8e-29) || !(x <= 2.2e-80)) 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 <= -2.8e-29) || ~((x <= 2.2e-80))) 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, -2.8e-29], N[Not[LessEqual[x, 2.2e-80]], $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 -2.8 \cdot 10^{-29} \lor \neg \left(x \leq 2.2 \cdot 10^{-80}\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 < -2.8000000000000002e-29 or 2.2000000000000001e-80 < 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.7%
if -2.8000000000000002e-29 < x < 2.2000000000000001e-80Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around 0 85.5%
Final simplification91.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.5e-44) (not (<= x 1.15e-57))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.5e-44) || !(x <= 1.15e-57)) {
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 <= (-4.5d-44)) .or. (.not. (x <= 1.15d-57))) 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 <= -4.5e-44) || !(x <= 1.15e-57)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.5e-44) or not (x <= 1.15e-57): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.5e-44) || !(x <= 1.15e-57)) 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 <= -4.5e-44) || ~((x <= 1.15e-57))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.5e-44], N[Not[LessEqual[x, 1.15e-57]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{-44} \lor \neg \left(x \leq 1.15 \cdot 10^{-57}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -4.4999999999999999e-44 or 1.15e-57 < x Initial program 100.0%
Taylor expanded in t around inf 41.2%
if -4.4999999999999999e-44 < x < 1.15e-57Initial program 99.9%
Taylor expanded in x around 0 68.4%
Final simplification53.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 100.0%
Taylor expanded in x around 0 33.2%
Final simplification33.2%
herbie shell --seed 2023318
(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)))