
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
(FPCore (x y z) :precision binary64 (fma z (cos y) (+ x (sin y))))
double code(double x, double y, double z) {
return fma(z, cos(y), (x + sin(y)));
}
function code(x, y, z) return fma(z, cos(y), Float64(x + sin(y))) end
code[x_, y_, z_] := N[(z * N[Cos[y], $MachinePrecision] + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, \cos y, x + \sin y\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -0.0098) (not (<= x 63000000.0))) (+ z x) (+ (sin y) (* z (cos y)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -0.0098) || !(x <= 63000000.0)) {
tmp = z + x;
} else {
tmp = sin(y) + (z * cos(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 ((x <= (-0.0098d0)) .or. (.not. (x <= 63000000.0d0))) then
tmp = z + x
else
tmp = sin(y) + (z * cos(y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -0.0098) || !(x <= 63000000.0)) {
tmp = z + x;
} else {
tmp = Math.sin(y) + (z * Math.cos(y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -0.0098) or not (x <= 63000000.0): tmp = z + x else: tmp = math.sin(y) + (z * math.cos(y)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -0.0098) || !(x <= 63000000.0)) tmp = Float64(z + x); else tmp = Float64(sin(y) + Float64(z * cos(y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -0.0098) || ~((x <= 63000000.0))) tmp = z + x; else tmp = sin(y) + (z * cos(y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -0.0098], N[Not[LessEqual[x, 63000000.0]], $MachinePrecision]], N[(z + x), $MachinePrecision], N[(N[Sin[y], $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0098 \lor \neg \left(x \leq 63000000\right):\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;\sin y + z \cdot \cos y\\
\end{array}
\end{array}
if x < -0.0097999999999999997 or 6.3e7 < x Initial program 99.9%
Taylor expanded in y around 0 86.0%
+-commutative86.0%
Simplified86.0%
if -0.0097999999999999997 < x < 6.3e7Initial program 99.9%
Taylor expanded in x around 0 90.4%
Final simplification88.3%
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -2.45e+191)
t_0
(if (<= z -4.1e-249) (+ z x) (if (<= z 5.3e+104) (+ z (+ y x)) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -2.45e+191) {
tmp = t_0;
} else if (z <= -4.1e-249) {
tmp = z + x;
} else if (z <= 5.3e+104) {
tmp = z + (y + 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 = z * cos(y)
if (z <= (-2.45d+191)) then
tmp = t_0
else if (z <= (-4.1d-249)) then
tmp = z + x
else if (z <= 5.3d+104) then
tmp = z + (y + x)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.cos(y);
double tmp;
if (z <= -2.45e+191) {
tmp = t_0;
} else if (z <= -4.1e-249) {
tmp = z + x;
} else if (z <= 5.3e+104) {
tmp = z + (y + x);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -2.45e+191: tmp = t_0 elif z <= -4.1e-249: tmp = z + x elif z <= 5.3e+104: tmp = z + (y + x) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -2.45e+191) tmp = t_0; elseif (z <= -4.1e-249) tmp = Float64(z + x); elseif (z <= 5.3e+104) tmp = Float64(z + Float64(y + x)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if (z <= -2.45e+191) tmp = t_0; elseif (z <= -4.1e-249) tmp = z + x; elseif (z <= 5.3e+104) tmp = z + (y + x); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.45e+191], t$95$0, If[LessEqual[z, -4.1e-249], N[(z + x), $MachinePrecision], If[LessEqual[z, 5.3e+104], N[(z + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -2.45 \cdot 10^{+191}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-249}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{+104}:\\
\;\;\;\;z + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.45e191 or 5.2999999999999999e104 < z Initial program 99.8%
Taylor expanded in z around inf 90.3%
if -2.45e191 < z < -4.10000000000000004e-249Initial program 99.9%
Taylor expanded in y around 0 70.7%
+-commutative70.7%
Simplified70.7%
if -4.10000000000000004e-249 < z < 5.2999999999999999e104Initial program 99.9%
Taylor expanded in y around 0 67.8%
+-commutative67.8%
+-commutative67.8%
associate-+l+67.8%
Simplified67.8%
Final simplification75.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -2.4e+191)
t_0
(if (<= z -5.5e-57) (+ z x) (if (<= z 0.47) (+ x (sin y)) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -2.4e+191) {
tmp = t_0;
} else if (z <= -5.5e-57) {
tmp = z + x;
} else if (z <= 0.47) {
tmp = x + sin(y);
} 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 = z * cos(y)
if (z <= (-2.4d+191)) then
tmp = t_0
else if (z <= (-5.5d-57)) then
tmp = z + x
else if (z <= 0.47d0) then
tmp = x + sin(y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.cos(y);
double tmp;
if (z <= -2.4e+191) {
tmp = t_0;
} else if (z <= -5.5e-57) {
tmp = z + x;
} else if (z <= 0.47) {
tmp = x + Math.sin(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -2.4e+191: tmp = t_0 elif z <= -5.5e-57: tmp = z + x elif z <= 0.47: tmp = x + math.sin(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -2.4e+191) tmp = t_0; elseif (z <= -5.5e-57) tmp = Float64(z + x); elseif (z <= 0.47) tmp = Float64(x + sin(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if (z <= -2.4e+191) tmp = t_0; elseif (z <= -5.5e-57) tmp = z + x; elseif (z <= 0.47) tmp = x + sin(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+191], t$95$0, If[LessEqual[z, -5.5e-57], N[(z + x), $MachinePrecision], If[LessEqual[z, 0.47], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+191}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-57}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;z \leq 0.47:\\
\;\;\;\;x + \sin y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.39999999999999986e191 or 0.46999999999999997 < z Initial program 99.8%
Taylor expanded in z around inf 82.6%
if -2.39999999999999986e191 < z < -5.50000000000000011e-57Initial program 99.8%
Taylor expanded in y around 0 78.4%
+-commutative78.4%
Simplified78.4%
if -5.50000000000000011e-57 < z < 0.46999999999999997Initial program 100.0%
Taylor expanded in z around 0 94.8%
+-commutative94.8%
Simplified94.8%
Final simplification87.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -1.05e+85)
(+ t_0 (+ y x))
(if (<= z -2.3e-60) (+ z x) (if (<= z 0.47) (+ x (sin y)) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -1.05e+85) {
tmp = t_0 + (y + x);
} else if (z <= -2.3e-60) {
tmp = z + x;
} else if (z <= 0.47) {
tmp = x + sin(y);
} 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 = z * cos(y)
if (z <= (-1.05d+85)) then
tmp = t_0 + (y + x)
else if (z <= (-2.3d-60)) then
tmp = z + x
else if (z <= 0.47d0) then
tmp = x + sin(y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.cos(y);
double tmp;
if (z <= -1.05e+85) {
tmp = t_0 + (y + x);
} else if (z <= -2.3e-60) {
tmp = z + x;
} else if (z <= 0.47) {
tmp = x + Math.sin(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -1.05e+85: tmp = t_0 + (y + x) elif z <= -2.3e-60: tmp = z + x elif z <= 0.47: tmp = x + math.sin(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -1.05e+85) tmp = Float64(t_0 + Float64(y + x)); elseif (z <= -2.3e-60) tmp = Float64(z + x); elseif (z <= 0.47) tmp = Float64(x + sin(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if (z <= -1.05e+85) tmp = t_0 + (y + x); elseif (z <= -2.3e-60) tmp = z + x; elseif (z <= 0.47) tmp = x + sin(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+85], N[(t$95$0 + N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-60], N[(z + x), $MachinePrecision], If[LessEqual[z, 0.47], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+85}:\\
\;\;\;\;t\_0 + \left(y + x\right)\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-60}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;z \leq 0.47:\\
\;\;\;\;x + \sin y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.05000000000000005e85Initial program 99.7%
Taylor expanded in y around 0 91.2%
+-commutative91.2%
Simplified91.2%
if -1.05000000000000005e85 < z < -2.3000000000000001e-60Initial program 99.9%
Taylor expanded in y around 0 79.1%
+-commutative79.1%
Simplified79.1%
if -2.3000000000000001e-60 < z < 0.46999999999999997Initial program 100.0%
Taylor expanded in z around 0 94.8%
+-commutative94.8%
Simplified94.8%
if 0.46999999999999997 < z Initial program 99.8%
Taylor expanded in z around inf 79.7%
Final simplification88.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -1e+86) (not (<= y 2.8e+34))) (+ z x) (+ z (+ y x))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1e+86) || !(y <= 2.8e+34)) {
tmp = z + x;
} else {
tmp = z + (y + 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 ((y <= (-1d+86)) .or. (.not. (y <= 2.8d+34))) then
tmp = z + x
else
tmp = z + (y + x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1e+86) || !(y <= 2.8e+34)) {
tmp = z + x;
} else {
tmp = z + (y + x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1e+86) or not (y <= 2.8e+34): tmp = z + x else: tmp = z + (y + x) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1e+86) || !(y <= 2.8e+34)) tmp = Float64(z + x); else tmp = Float64(z + Float64(y + x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1e+86) || ~((y <= 2.8e+34))) tmp = z + x; else tmp = z + (y + x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1e+86], N[Not[LessEqual[y, 2.8e+34]], $MachinePrecision]], N[(z + x), $MachinePrecision], N[(z + N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+86} \lor \neg \left(y \leq 2.8 \cdot 10^{+34}\right):\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;z + \left(y + x\right)\\
\end{array}
\end{array}
if y < -1e86 or 2.80000000000000008e34 < y Initial program 99.8%
Taylor expanded in y around 0 42.3%
+-commutative42.3%
Simplified42.3%
if -1e86 < y < 2.80000000000000008e34Initial program 100.0%
Taylor expanded in y around 0 89.6%
+-commutative89.6%
+-commutative89.6%
associate-+l+89.6%
Simplified89.6%
Final simplification70.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -7.5e-247) (not (<= z 1.32e-191))) (+ z x) (+ y x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -7.5e-247) || !(z <= 1.32e-191)) {
tmp = z + x;
} else {
tmp = y + 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 <= (-7.5d-247)) .or. (.not. (z <= 1.32d-191))) then
tmp = z + x
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -7.5e-247) || !(z <= 1.32e-191)) {
tmp = z + x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -7.5e-247) or not (z <= 1.32e-191): tmp = z + x else: tmp = y + x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -7.5e-247) || !(z <= 1.32e-191)) tmp = Float64(z + x); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -7.5e-247) || ~((z <= 1.32e-191))) tmp = z + x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -7.5e-247], N[Not[LessEqual[z, 1.32e-191]], $MachinePrecision]], N[(z + x), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-247} \lor \neg \left(z \leq 1.32 \cdot 10^{-191}\right):\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -7.5e-247 or 1.31999999999999996e-191 < z Initial program 99.9%
Taylor expanded in y around 0 66.6%
+-commutative66.6%
Simplified66.6%
if -7.5e-247 < z < 1.31999999999999996e-191Initial program 100.0%
Taylor expanded in y around 0 70.3%
+-commutative70.3%
Simplified70.3%
Taylor expanded in z around 0 70.3%
+-commutative70.3%
Simplified70.3%
Final simplification67.3%
(FPCore (x y z) :precision binary64 (if (<= y -1.05e+87) x (if (<= y 2.5e+34) (+ y x) x)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.05e+87) {
tmp = x;
} else if (y <= 2.5e+34) {
tmp = y + x;
} else {
tmp = 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 (y <= (-1.05d+87)) then
tmp = x
else if (y <= 2.5d+34) then
tmp = y + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.05e+87) {
tmp = x;
} else if (y <= 2.5e+34) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.05e+87: tmp = x elif y <= 2.5e+34: tmp = y + x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.05e+87) tmp = x; elseif (y <= 2.5e+34) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.05e+87) tmp = x; elseif (y <= 2.5e+34) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.05e+87], x, If[LessEqual[y, 2.5e+34], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+87}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+34}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.05e87 or 2.4999999999999999e34 < y Initial program 99.8%
Taylor expanded in x around inf 38.7%
if -1.05e87 < y < 2.4999999999999999e34Initial program 100.0%
Taylor expanded in y around 0 92.5%
+-commutative92.5%
Simplified92.5%
Taylor expanded in z around 0 51.5%
+-commutative51.5%
Simplified51.5%
Final simplification46.3%
(FPCore (x y z) :precision binary64 (if (<= x -5.4e-135) x (if (<= x 1.12e-127) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.4e-135) {
tmp = x;
} else if (x <= 1.12e-127) {
tmp = y;
} else {
tmp = 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 <= (-5.4d-135)) then
tmp = x
else if (x <= 1.12d-127) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5.4e-135) {
tmp = x;
} else if (x <= 1.12e-127) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.4e-135: tmp = x elif x <= 1.12e-127: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.4e-135) tmp = x; elseif (x <= 1.12e-127) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5.4e-135) tmp = x; elseif (x <= 1.12e-127) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.4e-135], x, If[LessEqual[x, 1.12e-127], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{-135}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{-127}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.39999999999999997e-135 or 1.1199999999999999e-127 < x Initial program 99.9%
Taylor expanded in x around inf 54.6%
if -5.39999999999999997e-135 < x < 1.1199999999999999e-127Initial program 99.8%
Taylor expanded in y around 0 68.2%
+-commutative68.2%
Simplified68.2%
Taylor expanded in y around inf 17.7%
Final simplification43.8%
(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 x around inf 40.5%
Final simplification40.5%
herbie shell --seed 2024039
(FPCore (x y z)
:name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C"
:precision binary64
(+ (+ x (sin y)) (* z (cos y))))