
(FPCore (x y z) :precision binary64 (+ (+ (+ (+ (+ x y) y) x) z) x))
double code(double x, double y, double z) {
return ((((x + y) + y) + x) + z) + x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x + y) + y) + x) + z) + x
end function
public static double code(double x, double y, double z) {
return ((((x + y) + y) + x) + z) + x;
}
def code(x, y, z): return ((((x + y) + y) + x) + z) + x
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x + y) + y) + x) + z) + x) end
function tmp = code(x, y, z) tmp = ((((x + y) + y) + x) + z) + x; end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (+ (+ (+ (+ x y) y) x) z) x))
double code(double x, double y, double z) {
return ((((x + y) + y) + x) + z) + x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x + y) + y) + x) + z) + x
end function
public static double code(double x, double y, double z) {
return ((((x + y) + y) + x) + z) + x;
}
def code(x, y, z): return ((((x + y) + y) + x) + z) + x
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x + y) + y) + x) + z) + x) end
function tmp = code(x, y, z) tmp = ((((x + y) + y) + x) + z) + x; end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x
\end{array}
(FPCore (x y z) :precision binary64 (fma x 3.0 (+ (* y 2.0) z)))
double code(double x, double y, double z) {
return fma(x, 3.0, ((y * 2.0) + z));
}
function code(x, y, z) return fma(x, 3.0, Float64(Float64(y * 2.0) + z)) end
code[x_, y_, z_] := N[(x * 3.0 + N[(N[(y * 2.0), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, 3, y \cdot 2 + z\right)
\end{array}
Initial program 99.9%
Simplified0
Applied egg-rr0
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (* 2.0 y) x)))
(if (<= y -4.2e+123)
t_0
(if (<= y -8.6e-163)
(* 3.0 x)
(if (<= y -4.6e-238)
(+ z x)
(if (<= y 5.4e-223)
(* 3.0 x)
(if (<= y 7.6e-26) (+ z x) (if (<= y 4e+100) (* 3.0 x) t_0))))))))
double code(double x, double y, double z) {
double t_0 = (2.0 * y) + x;
double tmp;
if (y <= -4.2e+123) {
tmp = t_0;
} else if (y <= -8.6e-163) {
tmp = 3.0 * x;
} else if (y <= -4.6e-238) {
tmp = z + x;
} else if (y <= 5.4e-223) {
tmp = 3.0 * x;
} else if (y <= 7.6e-26) {
tmp = z + x;
} else if (y <= 4e+100) {
tmp = 3.0 * x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (2.0d0 * y) + x
if (y <= (-4.2d+123)) then
tmp = t_0
else if (y <= (-8.6d-163)) then
tmp = 3.0d0 * x
else if (y <= (-4.6d-238)) then
tmp = z + x
else if (y <= 5.4d-223) then
tmp = 3.0d0 * x
else if (y <= 7.6d-26) then
tmp = z + x
else if (y <= 4d+100) then
tmp = 3.0d0 * x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (2.0 * y) + x;
double tmp;
if (y <= -4.2e+123) {
tmp = t_0;
} else if (y <= -8.6e-163) {
tmp = 3.0 * x;
} else if (y <= -4.6e-238) {
tmp = z + x;
} else if (y <= 5.4e-223) {
tmp = 3.0 * x;
} else if (y <= 7.6e-26) {
tmp = z + x;
} else if (y <= 4e+100) {
tmp = 3.0 * x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (2.0 * y) + x tmp = 0 if y <= -4.2e+123: tmp = t_0 elif y <= -8.6e-163: tmp = 3.0 * x elif y <= -4.6e-238: tmp = z + x elif y <= 5.4e-223: tmp = 3.0 * x elif y <= 7.6e-26: tmp = z + x elif y <= 4e+100: tmp = 3.0 * x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(2.0 * y) + x) tmp = 0.0 if (y <= -4.2e+123) tmp = t_0; elseif (y <= -8.6e-163) tmp = Float64(3.0 * x); elseif (y <= -4.6e-238) tmp = Float64(z + x); elseif (y <= 5.4e-223) tmp = Float64(3.0 * x); elseif (y <= 7.6e-26) tmp = Float64(z + x); elseif (y <= 4e+100) tmp = Float64(3.0 * x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (2.0 * y) + x; tmp = 0.0; if (y <= -4.2e+123) tmp = t_0; elseif (y <= -8.6e-163) tmp = 3.0 * x; elseif (y <= -4.6e-238) tmp = z + x; elseif (y <= 5.4e-223) tmp = 3.0 * x; elseif (y <= 7.6e-26) tmp = z + x; elseif (y <= 4e+100) tmp = 3.0 * x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(2.0 * y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -4.2e+123], t$95$0, If[LessEqual[y, -8.6e-163], N[(3.0 * x), $MachinePrecision], If[LessEqual[y, -4.6e-238], N[(z + x), $MachinePrecision], If[LessEqual[y, 5.4e-223], N[(3.0 * x), $MachinePrecision], If[LessEqual[y, 7.6e-26], N[(z + x), $MachinePrecision], If[LessEqual[y, 4e+100], N[(3.0 * x), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot y + x\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+123}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -8.6 \cdot 10^{-163}:\\
\;\;\;\;3 \cdot x\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{-238}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-223}:\\
\;\;\;\;3 \cdot x\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-26}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+100}:\\
\;\;\;\;3 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -4.19999999999999988e123 or 4.00000000000000006e100 < y Initial program 100.0%
Taylor expanded in y around inf 0
Simplified0
if -4.19999999999999988e123 < y < -8.60000000000000017e-163 or -4.60000000000000009e-238 < y < 5.39999999999999977e-223 or 7.60000000000000029e-26 < y < 4.00000000000000006e100Initial program 99.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -8.60000000000000017e-163 < y < -4.60000000000000009e-238 or 5.39999999999999977e-223 < y < 7.60000000000000029e-26Initial program 99.9%
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z)
:precision binary64
(if (<= y -4.2e+123)
(* 2.0 y)
(if (<= y -2.7e-161)
(* 3.0 x)
(if (<= y -2.2e-240)
(+ z x)
(if (<= y 2.7e-224)
(* 3.0 x)
(if (<= y 4.5e-27)
(+ z x)
(if (<= y 2.7e+112) (* 3.0 x) (* 2.0 y))))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -4.2e+123) {
tmp = 2.0 * y;
} else if (y <= -2.7e-161) {
tmp = 3.0 * x;
} else if (y <= -2.2e-240) {
tmp = z + x;
} else if (y <= 2.7e-224) {
tmp = 3.0 * x;
} else if (y <= 4.5e-27) {
tmp = z + x;
} else if (y <= 2.7e+112) {
tmp = 3.0 * x;
} else {
tmp = 2.0 * y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-4.2d+123)) then
tmp = 2.0d0 * y
else if (y <= (-2.7d-161)) then
tmp = 3.0d0 * x
else if (y <= (-2.2d-240)) then
tmp = z + x
else if (y <= 2.7d-224) then
tmp = 3.0d0 * x
else if (y <= 4.5d-27) then
tmp = z + x
else if (y <= 2.7d+112) then
tmp = 3.0d0 * x
else
tmp = 2.0d0 * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -4.2e+123) {
tmp = 2.0 * y;
} else if (y <= -2.7e-161) {
tmp = 3.0 * x;
} else if (y <= -2.2e-240) {
tmp = z + x;
} else if (y <= 2.7e-224) {
tmp = 3.0 * x;
} else if (y <= 4.5e-27) {
tmp = z + x;
} else if (y <= 2.7e+112) {
tmp = 3.0 * x;
} else {
tmp = 2.0 * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4.2e+123: tmp = 2.0 * y elif y <= -2.7e-161: tmp = 3.0 * x elif y <= -2.2e-240: tmp = z + x elif y <= 2.7e-224: tmp = 3.0 * x elif y <= 4.5e-27: tmp = z + x elif y <= 2.7e+112: tmp = 3.0 * x else: tmp = 2.0 * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4.2e+123) tmp = Float64(2.0 * y); elseif (y <= -2.7e-161) tmp = Float64(3.0 * x); elseif (y <= -2.2e-240) tmp = Float64(z + x); elseif (y <= 2.7e-224) tmp = Float64(3.0 * x); elseif (y <= 4.5e-27) tmp = Float64(z + x); elseif (y <= 2.7e+112) tmp = Float64(3.0 * x); else tmp = Float64(2.0 * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4.2e+123) tmp = 2.0 * y; elseif (y <= -2.7e-161) tmp = 3.0 * x; elseif (y <= -2.2e-240) tmp = z + x; elseif (y <= 2.7e-224) tmp = 3.0 * x; elseif (y <= 4.5e-27) tmp = z + x; elseif (y <= 2.7e+112) tmp = 3.0 * x; else tmp = 2.0 * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4.2e+123], N[(2.0 * y), $MachinePrecision], If[LessEqual[y, -2.7e-161], N[(3.0 * x), $MachinePrecision], If[LessEqual[y, -2.2e-240], N[(z + x), $MachinePrecision], If[LessEqual[y, 2.7e-224], N[(3.0 * x), $MachinePrecision], If[LessEqual[y, 4.5e-27], N[(z + x), $MachinePrecision], If[LessEqual[y, 2.7e+112], N[(3.0 * x), $MachinePrecision], N[(2.0 * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+123}:\\
\;\;\;\;2 \cdot y\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-161}:\\
\;\;\;\;3 \cdot x\\
\mathbf{elif}\;y \leq -2.2 \cdot 10^{-240}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-224}:\\
\;\;\;\;3 \cdot x\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-27}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+112}:\\
\;\;\;\;3 \cdot x\\
\mathbf{else}:\\
\;\;\;\;2 \cdot y\\
\end{array}
\end{array}
if y < -4.19999999999999988e123 or 2.7000000000000001e112 < y Initial program 100.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if -4.19999999999999988e123 < y < -2.6999999999999999e-161 or -2.1999999999999999e-240 < y < 2.69999999999999998e-224 or 4.5000000000000002e-27 < y < 2.7000000000000001e112Initial program 99.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -2.6999999999999999e-161 < y < -2.1999999999999999e-240 or 2.69999999999999998e-224 < y < 4.5000000000000002e-27Initial program 99.9%
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z)
:precision binary64
(if (<= y -1.85e+125)
(* 2.0 y)
(if (<= y -1.55e-162)
(* 3.0 x)
(if (<= y -6e-211)
z
(if (<= y 2.2e-223)
(* 3.0 x)
(if (<= y 3e-22) z (if (<= y 2.4e+112) (* 3.0 x) (* 2.0 y))))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.85e+125) {
tmp = 2.0 * y;
} else if (y <= -1.55e-162) {
tmp = 3.0 * x;
} else if (y <= -6e-211) {
tmp = z;
} else if (y <= 2.2e-223) {
tmp = 3.0 * x;
} else if (y <= 3e-22) {
tmp = z;
} else if (y <= 2.4e+112) {
tmp = 3.0 * x;
} else {
tmp = 2.0 * y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.85d+125)) then
tmp = 2.0d0 * y
else if (y <= (-1.55d-162)) then
tmp = 3.0d0 * x
else if (y <= (-6d-211)) then
tmp = z
else if (y <= 2.2d-223) then
tmp = 3.0d0 * x
else if (y <= 3d-22) then
tmp = z
else if (y <= 2.4d+112) then
tmp = 3.0d0 * x
else
tmp = 2.0d0 * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.85e+125) {
tmp = 2.0 * y;
} else if (y <= -1.55e-162) {
tmp = 3.0 * x;
} else if (y <= -6e-211) {
tmp = z;
} else if (y <= 2.2e-223) {
tmp = 3.0 * x;
} else if (y <= 3e-22) {
tmp = z;
} else if (y <= 2.4e+112) {
tmp = 3.0 * x;
} else {
tmp = 2.0 * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.85e+125: tmp = 2.0 * y elif y <= -1.55e-162: tmp = 3.0 * x elif y <= -6e-211: tmp = z elif y <= 2.2e-223: tmp = 3.0 * x elif y <= 3e-22: tmp = z elif y <= 2.4e+112: tmp = 3.0 * x else: tmp = 2.0 * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.85e+125) tmp = Float64(2.0 * y); elseif (y <= -1.55e-162) tmp = Float64(3.0 * x); elseif (y <= -6e-211) tmp = z; elseif (y <= 2.2e-223) tmp = Float64(3.0 * x); elseif (y <= 3e-22) tmp = z; elseif (y <= 2.4e+112) tmp = Float64(3.0 * x); else tmp = Float64(2.0 * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.85e+125) tmp = 2.0 * y; elseif (y <= -1.55e-162) tmp = 3.0 * x; elseif (y <= -6e-211) tmp = z; elseif (y <= 2.2e-223) tmp = 3.0 * x; elseif (y <= 3e-22) tmp = z; elseif (y <= 2.4e+112) tmp = 3.0 * x; else tmp = 2.0 * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.85e+125], N[(2.0 * y), $MachinePrecision], If[LessEqual[y, -1.55e-162], N[(3.0 * x), $MachinePrecision], If[LessEqual[y, -6e-211], z, If[LessEqual[y, 2.2e-223], N[(3.0 * x), $MachinePrecision], If[LessEqual[y, 3e-22], z, If[LessEqual[y, 2.4e+112], N[(3.0 * x), $MachinePrecision], N[(2.0 * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{+125}:\\
\;\;\;\;2 \cdot y\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{-162}:\\
\;\;\;\;3 \cdot x\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-211}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-223}:\\
\;\;\;\;3 \cdot x\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-22}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+112}:\\
\;\;\;\;3 \cdot x\\
\mathbf{else}:\\
\;\;\;\;2 \cdot y\\
\end{array}
\end{array}
if y < -1.8499999999999999e125 or 2.4e112 < y Initial program 100.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if -1.8499999999999999e125 < y < -1.5499999999999999e-162 or -6.00000000000000009e-211 < y < 2.20000000000000009e-223 or 2.9999999999999999e-22 < y < 2.4e112Initial program 99.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -1.5499999999999999e-162 < y < -6.00000000000000009e-211 or 2.20000000000000009e-223 < y < 2.9999999999999999e-22Initial program 99.9%
Simplified0
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= z -2e-23) (+ (* 2.0 y) z) (if (<= z 2.95e+16) (+ (* 2.0 (+ x y)) x) (+ (+ (+ x x) z) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2e-23) {
tmp = (2.0 * y) + z;
} else if (z <= 2.95e+16) {
tmp = (2.0 * (x + y)) + x;
} else {
tmp = ((x + x) + z) + x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-2d-23)) then
tmp = (2.0d0 * y) + z
else if (z <= 2.95d+16) then
tmp = (2.0d0 * (x + y)) + x
else
tmp = ((x + x) + z) + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2e-23) {
tmp = (2.0 * y) + z;
} else if (z <= 2.95e+16) {
tmp = (2.0 * (x + y)) + x;
} else {
tmp = ((x + x) + z) + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2e-23: tmp = (2.0 * y) + z elif z <= 2.95e+16: tmp = (2.0 * (x + y)) + x else: tmp = ((x + x) + z) + x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2e-23) tmp = Float64(Float64(2.0 * y) + z); elseif (z <= 2.95e+16) tmp = Float64(Float64(2.0 * Float64(x + y)) + x); else tmp = Float64(Float64(Float64(x + x) + z) + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2e-23) tmp = (2.0 * y) + z; elseif (z <= 2.95e+16) tmp = (2.0 * (x + y)) + x; else tmp = ((x + x) + z) + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2e-23], N[(N[(2.0 * y), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[z, 2.95e+16], N[(N[(2.0 * N[(x + y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(x + x), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-23}:\\
\;\;\;\;2 \cdot y + z\\
\mathbf{elif}\;z \leq 2.95 \cdot 10^{+16}:\\
\;\;\;\;2 \cdot \left(x + y\right) + x\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x + x\right) + z\right) + x\\
\end{array}
\end{array}
if z < -1.99999999999999992e-23Initial program 99.9%
Simplified0
Taylor expanded in x around 0 0
Simplified0
if -1.99999999999999992e-23 < z < 2.95e16Initial program 99.8%
Taylor expanded in z around 0 0
Simplified0
if 2.95e16 < z Initial program 100.0%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= z -4.6e-21) (+ (* 2.0 y) z) (if (<= z 1.42e+17) (+ (* 2.0 (+ x y)) x) (+ (* 3.0 x) z))))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.6e-21) {
tmp = (2.0 * y) + z;
} else if (z <= 1.42e+17) {
tmp = (2.0 * (x + y)) + x;
} else {
tmp = (3.0 * x) + z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-4.6d-21)) then
tmp = (2.0d0 * y) + z
else if (z <= 1.42d+17) then
tmp = (2.0d0 * (x + y)) + x
else
tmp = (3.0d0 * x) + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.6e-21) {
tmp = (2.0 * y) + z;
} else if (z <= 1.42e+17) {
tmp = (2.0 * (x + y)) + x;
} else {
tmp = (3.0 * x) + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.6e-21: tmp = (2.0 * y) + z elif z <= 1.42e+17: tmp = (2.0 * (x + y)) + x else: tmp = (3.0 * x) + z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.6e-21) tmp = Float64(Float64(2.0 * y) + z); elseif (z <= 1.42e+17) tmp = Float64(Float64(2.0 * Float64(x + y)) + x); else tmp = Float64(Float64(3.0 * x) + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.6e-21) tmp = (2.0 * y) + z; elseif (z <= 1.42e+17) tmp = (2.0 * (x + y)) + x; else tmp = (3.0 * x) + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.6e-21], N[(N[(2.0 * y), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[z, 1.42e+17], N[(N[(2.0 * N[(x + y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(3.0 * x), $MachinePrecision] + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-21}:\\
\;\;\;\;2 \cdot y + z\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{+17}:\\
\;\;\;\;2 \cdot \left(x + y\right) + x\\
\mathbf{else}:\\
\;\;\;\;3 \cdot x + z\\
\end{array}
\end{array}
if z < -4.59999999999999999e-21Initial program 99.9%
Simplified0
Taylor expanded in x around 0 0
Simplified0
if -4.59999999999999999e-21 < z < 1.42e17Initial program 99.8%
Taylor expanded in z around 0 0
Simplified0
if 1.42e17 < z Initial program 100.0%
Simplified0
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ (* 2.0 y) z))) (if (<= y -1.5e+124) t_0 (if (<= y 5.5e+112) (+ (* 3.0 x) z) t_0))))
double code(double x, double y, double z) {
double t_0 = (2.0 * y) + z;
double tmp;
if (y <= -1.5e+124) {
tmp = t_0;
} else if (y <= 5.5e+112) {
tmp = (3.0 * x) + z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (2.0d0 * y) + z
if (y <= (-1.5d+124)) then
tmp = t_0
else if (y <= 5.5d+112) then
tmp = (3.0d0 * x) + z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (2.0 * y) + z;
double tmp;
if (y <= -1.5e+124) {
tmp = t_0;
} else if (y <= 5.5e+112) {
tmp = (3.0 * x) + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (2.0 * y) + z tmp = 0 if y <= -1.5e+124: tmp = t_0 elif y <= 5.5e+112: tmp = (3.0 * x) + z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(2.0 * y) + z) tmp = 0.0 if (y <= -1.5e+124) tmp = t_0; elseif (y <= 5.5e+112) tmp = Float64(Float64(3.0 * x) + z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (2.0 * y) + z; tmp = 0.0; if (y <= -1.5e+124) tmp = t_0; elseif (y <= 5.5e+112) tmp = (3.0 * x) + z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(2.0 * y), $MachinePrecision] + z), $MachinePrecision]}, If[LessEqual[y, -1.5e+124], t$95$0, If[LessEqual[y, 5.5e+112], N[(N[(3.0 * x), $MachinePrecision] + z), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot y + z\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{+124}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+112}:\\
\;\;\;\;3 \cdot x + z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.5e124 or 5.50000000000000026e112 < y Initial program 100.0%
Simplified0
Taylor expanded in x around 0 0
Simplified0
if -1.5e124 < y < 5.50000000000000026e112Initial program 99.9%
Simplified0
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= x -4.7e+60) (* 3.0 x) (if (<= x 2.9e+106) (+ (* 2.0 y) z) (* 3.0 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.7e+60) {
tmp = 3.0 * x;
} else if (x <= 2.9e+106) {
tmp = (2.0 * y) + z;
} else {
tmp = 3.0 * x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.7d+60)) then
tmp = 3.0d0 * x
else if (x <= 2.9d+106) then
tmp = (2.0d0 * y) + z
else
tmp = 3.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.7e+60) {
tmp = 3.0 * x;
} else if (x <= 2.9e+106) {
tmp = (2.0 * y) + z;
} else {
tmp = 3.0 * x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.7e+60: tmp = 3.0 * x elif x <= 2.9e+106: tmp = (2.0 * y) + z else: tmp = 3.0 * x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.7e+60) tmp = Float64(3.0 * x); elseif (x <= 2.9e+106) tmp = Float64(Float64(2.0 * y) + z); else tmp = Float64(3.0 * x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.7e+60) tmp = 3.0 * x; elseif (x <= 2.9e+106) tmp = (2.0 * y) + z; else tmp = 3.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.7e+60], N[(3.0 * x), $MachinePrecision], If[LessEqual[x, 2.9e+106], N[(N[(2.0 * y), $MachinePrecision] + z), $MachinePrecision], N[(3.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{+60}:\\
\;\;\;\;3 \cdot x\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+106}:\\
\;\;\;\;2 \cdot y + z\\
\mathbf{else}:\\
\;\;\;\;3 \cdot x\\
\end{array}
\end{array}
if x < -4.6999999999999998e60 or 2.9000000000000002e106 < x Initial program 99.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -4.6999999999999998e60 < x < 2.9000000000000002e106Initial program 99.9%
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= z -1.15e-21) z (if (<= z 3.25e+16) (* 2.0 y) z)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.15e-21) {
tmp = z;
} else if (z <= 3.25e+16) {
tmp = 2.0 * y;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.15d-21)) then
tmp = z
else if (z <= 3.25d+16) then
tmp = 2.0d0 * y
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.15e-21) {
tmp = z;
} else if (z <= 3.25e+16) {
tmp = 2.0 * y;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.15e-21: tmp = z elif z <= 3.25e+16: tmp = 2.0 * y else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.15e-21) tmp = z; elseif (z <= 3.25e+16) tmp = Float64(2.0 * y); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.15e-21) tmp = z; elseif (z <= 3.25e+16) tmp = 2.0 * y; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.15e-21], z, If[LessEqual[z, 3.25e+16], N[(2.0 * y), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-21}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{+16}:\\
\;\;\;\;2 \cdot y\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.15e-21 or 3.25e16 < z Initial program 100.0%
Simplified0
Taylor expanded in z around inf 0
Simplified0
if -1.15e-21 < z < 3.25e16Initial program 99.8%
Simplified0
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (+ z (+ (* y 2.0) (* x 3.0))))
double code(double x, double y, double z) {
return z + ((y * 2.0) + (x * 3.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = z + ((y * 2.0d0) + (x * 3.0d0))
end function
public static double code(double x, double y, double z) {
return z + ((y * 2.0) + (x * 3.0));
}
def code(x, y, z): return z + ((y * 2.0) + (x * 3.0))
function code(x, y, z) return Float64(z + Float64(Float64(y * 2.0) + Float64(x * 3.0))) end
function tmp = code(x, y, z) tmp = z + ((y * 2.0) + (x * 3.0)); end
code[x_, y_, z_] := N[(z + N[(N[(y * 2.0), $MachinePrecision] + N[(x * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z + \left(y \cdot 2 + x \cdot 3\right)
\end{array}
Initial program 99.9%
Simplified0
(FPCore (x y z) :precision binary64 z)
double code(double x, double y, double z) {
return z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = z
end function
public static double code(double x, double y, double z) {
return z;
}
def code(x, y, z): return z
function code(x, y, z) return z end
function tmp = code(x, y, z) tmp = z; end
code[x_, y_, z_] := z
\begin{array}{l}
\\
z
\end{array}
Initial program 99.9%
Simplified0
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
Taylor expanded in z around inf 0
Simplified0
Taylor expanded in z around 0 0
Simplified0
herbie shell --seed 2024110
(FPCore (x y z)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendInside from plot-0.2.3.4"
:precision binary64
(+ (+ (+ (+ (+ x y) y) x) z) x))