
(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 10 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 (+ (* z (cos y)) (+ x (sin y))))
double code(double x, double y, double z) {
return (z * cos(y)) + (x + sin(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (z * cos(y)) + (x + sin(y))
end function
public static double code(double x, double y, double z) {
return (z * Math.cos(y)) + (x + Math.sin(y));
}
def code(x, y, z): return (z * math.cos(y)) + (x + math.sin(y))
function code(x, y, z) return Float64(Float64(z * cos(y)) + Float64(x + sin(y))) end
function tmp = code(x, y, z) tmp = (z * cos(y)) + (x + sin(y)); end
code[x_, y_, z_] := N[(N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision] + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \cos y + \left(x + \sin y\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -7e+198)
t_0
(if (<= z -4.5e+112)
(+ x z)
(if (<= z -5.8e+64)
t_0
(if (<= z 1.65e-96)
(+ x (sin y))
(if (<= z 3.4e+162) (+ x z) t_0)))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -7e+198) {
tmp = t_0;
} else if (z <= -4.5e+112) {
tmp = x + z;
} else if (z <= -5.8e+64) {
tmp = t_0;
} else if (z <= 1.65e-96) {
tmp = x + sin(y);
} else if (z <= 3.4e+162) {
tmp = 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 = z * cos(y)
if (z <= (-7d+198)) then
tmp = t_0
else if (z <= (-4.5d+112)) then
tmp = x + z
else if (z <= (-5.8d+64)) then
tmp = t_0
else if (z <= 1.65d-96) then
tmp = x + sin(y)
else if (z <= 3.4d+162) then
tmp = 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 = z * Math.cos(y);
double tmp;
if (z <= -7e+198) {
tmp = t_0;
} else if (z <= -4.5e+112) {
tmp = x + z;
} else if (z <= -5.8e+64) {
tmp = t_0;
} else if (z <= 1.65e-96) {
tmp = x + Math.sin(y);
} else if (z <= 3.4e+162) {
tmp = x + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -7e+198: tmp = t_0 elif z <= -4.5e+112: tmp = x + z elif z <= -5.8e+64: tmp = t_0 elif z <= 1.65e-96: tmp = x + math.sin(y) elif z <= 3.4e+162: tmp = x + z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -7e+198) tmp = t_0; elseif (z <= -4.5e+112) tmp = Float64(x + z); elseif (z <= -5.8e+64) tmp = t_0; elseif (z <= 1.65e-96) tmp = Float64(x + sin(y)); elseif (z <= 3.4e+162) tmp = Float64(x + z); 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 <= -7e+198) tmp = t_0; elseif (z <= -4.5e+112) tmp = x + z; elseif (z <= -5.8e+64) tmp = t_0; elseif (z <= 1.65e-96) tmp = x + sin(y); elseif (z <= 3.4e+162) tmp = x + z; 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, -7e+198], t$95$0, If[LessEqual[z, -4.5e+112], N[(x + z), $MachinePrecision], If[LessEqual[z, -5.8e+64], t$95$0, If[LessEqual[z, 1.65e-96], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+162], N[(x + z), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -7 \cdot 10^{+198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{+112}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{+64}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-96}:\\
\;\;\;\;x + \sin y\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+162}:\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -7.00000000000000026e198 or -4.4999999999999999e112 < z < -5.79999999999999986e64 or 3.40000000000000003e162 < z Initial program 99.8%
Taylor expanded in x around inf 99.8%
Taylor expanded in x around 0 92.4%
if -7.00000000000000026e198 < z < -4.4999999999999999e112 or 1.64999999999999995e-96 < z < 3.40000000000000003e162Initial program 99.9%
Taylor expanded in x around inf 96.5%
Taylor expanded in y around 0 85.3%
if -5.79999999999999986e64 < z < 1.64999999999999995e-96Initial program 100.0%
Taylor expanded in y around 0 76.3%
fma-def76.3%
*-commutative76.3%
unpow276.3%
Simplified76.3%
Taylor expanded in z around 0 93.3%
Final simplification90.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -6e+203)
t_0
(if (<= z 4.5e-97) (+ z (+ x y)) (if (<= z 9.5e+158) (+ x z) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -6e+203) {
tmp = t_0;
} else if (z <= 4.5e-97) {
tmp = z + (x + y);
} else if (z <= 9.5e+158) {
tmp = 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 = z * cos(y)
if (z <= (-6d+203)) then
tmp = t_0
else if (z <= 4.5d-97) then
tmp = z + (x + y)
else if (z <= 9.5d+158) then
tmp = 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 = z * Math.cos(y);
double tmp;
if (z <= -6e+203) {
tmp = t_0;
} else if (z <= 4.5e-97) {
tmp = z + (x + y);
} else if (z <= 9.5e+158) {
tmp = x + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -6e+203: tmp = t_0 elif z <= 4.5e-97: tmp = z + (x + y) elif z <= 9.5e+158: tmp = x + z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -6e+203) tmp = t_0; elseif (z <= 4.5e-97) tmp = Float64(z + Float64(x + y)); elseif (z <= 9.5e+158) tmp = Float64(x + z); 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 <= -6e+203) tmp = t_0; elseif (z <= 4.5e-97) tmp = z + (x + y); elseif (z <= 9.5e+158) tmp = x + z; 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, -6e+203], t$95$0, If[LessEqual[z, 4.5e-97], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+158], N[(x + z), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -6 \cdot 10^{+203}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-97}:\\
\;\;\;\;z + \left(x + y\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+158}:\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -5.9999999999999999e203 or 9.49999999999999913e158 < z Initial program 99.8%
Taylor expanded in x around inf 99.8%
Taylor expanded in x around 0 91.2%
if -5.9999999999999999e203 < z < 4.5000000000000001e-97Initial program 100.0%
Taylor expanded in y around 0 96.6%
Taylor expanded in y around 0 75.0%
if 4.5000000000000001e-97 < z < 9.49999999999999913e158Initial program 99.9%
Taylor expanded in x around inf 95.8%
Taylor expanded in y around 0 84.2%
Final simplification80.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.06) (not (<= z 2.9e-114))) (+ x (* z (cos y))) (+ x (sin y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.06) || !(z <= 2.9e-114)) {
tmp = x + (z * cos(y));
} else {
tmp = x + sin(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 ((z <= (-0.06d0)) .or. (.not. (z <= 2.9d-114))) then
tmp = x + (z * cos(y))
else
tmp = x + sin(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.06) || !(z <= 2.9e-114)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = x + Math.sin(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.06) or not (z <= 2.9e-114): tmp = x + (z * math.cos(y)) else: tmp = x + math.sin(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.06) || !(z <= 2.9e-114)) tmp = Float64(x + Float64(z * cos(y))); else tmp = Float64(x + sin(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.06) || ~((z <= 2.9e-114))) tmp = x + (z * cos(y)); else tmp = x + sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.06], N[Not[LessEqual[z, 2.9e-114]], $MachinePrecision]], N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.06 \lor \neg \left(z \leq 2.9 \cdot 10^{-114}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \sin y\\
\end{array}
\end{array}
if z < -0.059999999999999998 or 2.89999999999999997e-114 < z Initial program 99.9%
Taylor expanded in x around inf 97.6%
if -0.059999999999999998 < z < 2.89999999999999997e-114Initial program 100.0%
Taylor expanded in y around 0 78.2%
fma-def78.2%
*-commutative78.2%
unpow278.2%
Simplified78.2%
Taylor expanded in z around 0 96.1%
Final simplification97.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -9.6e+37) (not (<= z 2.65e-14))) (+ x (* z (cos y))) (+ z (+ x (sin y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -9.6e+37) || !(z <= 2.65e-14)) {
tmp = x + (z * cos(y));
} else {
tmp = z + (x + sin(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 ((z <= (-9.6d+37)) .or. (.not. (z <= 2.65d-14))) then
tmp = x + (z * cos(y))
else
tmp = z + (x + sin(y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -9.6e+37) || !(z <= 2.65e-14)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = z + (x + Math.sin(y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -9.6e+37) or not (z <= 2.65e-14): tmp = x + (z * math.cos(y)) else: tmp = z + (x + math.sin(y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -9.6e+37) || !(z <= 2.65e-14)) tmp = Float64(x + Float64(z * cos(y))); else tmp = Float64(z + Float64(x + sin(y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -9.6e+37) || ~((z <= 2.65e-14))) tmp = x + (z * cos(y)); else tmp = z + (x + sin(y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -9.6e+37], N[Not[LessEqual[z, 2.65e-14]], $MachinePrecision]], N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{+37} \lor \neg \left(z \leq 2.65 \cdot 10^{-14}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;z + \left(x + \sin y\right)\\
\end{array}
\end{array}
if z < -9.5999999999999999e37 or 2.6500000000000001e-14 < z Initial program 99.8%
Taylor expanded in x around inf 99.3%
if -9.5999999999999999e37 < z < 2.6500000000000001e-14Initial program 100.0%
Taylor expanded in y around 0 99.9%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (if (<= y -620000.0) (+ x z) (if (<= y 3.1) (+ z (+ x y)) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -620000.0) {
tmp = x + z;
} else if (y <= 3.1) {
tmp = z + (x + y);
} else {
tmp = 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 (y <= (-620000.0d0)) then
tmp = x + z
else if (y <= 3.1d0) then
tmp = z + (x + y)
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -620000.0) {
tmp = x + z;
} else if (y <= 3.1) {
tmp = z + (x + y);
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -620000.0: tmp = x + z elif y <= 3.1: tmp = z + (x + y) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -620000.0) tmp = Float64(x + z); elseif (y <= 3.1) tmp = Float64(z + Float64(x + y)); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -620000.0) tmp = x + z; elseif (y <= 3.1) tmp = z + (x + y); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -620000.0], N[(x + z), $MachinePrecision], If[LessEqual[y, 3.1], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -620000:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 3.1:\\
\;\;\;\;z + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -6.2e5 or 3.10000000000000009 < y Initial program 99.8%
Taylor expanded in x around inf 79.0%
Taylor expanded in y around 0 47.6%
if -6.2e5 < y < 3.10000000000000009Initial program 100.0%
Taylor expanded in y around 0 99.8%
Taylor expanded in y around 0 99.3%
Final simplification76.9%
(FPCore (x y z) :precision binary64 (if (<= x -1.8e-14) x (if (<= x 4e-68) (+ x y) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.8e-14) {
tmp = x;
} else if (x <= 4e-68) {
tmp = x + 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 <= (-1.8d-14)) then
tmp = x
else if (x <= 4d-68) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.8e-14) {
tmp = x;
} else if (x <= 4e-68) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.8e-14: tmp = x elif x <= 4e-68: tmp = x + y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.8e-14) tmp = x; elseif (x <= 4e-68) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.8e-14) tmp = x; elseif (x <= 4e-68) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.8e-14], x, If[LessEqual[x, 4e-68], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-68}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.7999999999999999e-14 or 4.00000000000000027e-68 < x Initial program 99.9%
Taylor expanded in x around inf 95.3%
Taylor expanded in x around inf 68.6%
if -1.7999999999999999e-14 < x < 4.00000000000000027e-68Initial program 99.9%
Taylor expanded in y around 0 67.4%
fma-def67.4%
*-commutative67.4%
unpow267.4%
Simplified67.4%
Taylor expanded in z around 0 44.6%
Taylor expanded in y around 0 28.7%
Final simplification52.7%
(FPCore (x y z) :precision binary64 (if (<= x -9.2e-164) (+ x z) (if (<= x 1.8e-83) (+ y z) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -9.2e-164) {
tmp = x + z;
} else if (x <= 1.8e-83) {
tmp = y + z;
} else {
tmp = 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 (x <= (-9.2d-164)) then
tmp = x + z
else if (x <= 1.8d-83) then
tmp = y + z
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -9.2e-164) {
tmp = x + z;
} else if (x <= 1.8e-83) {
tmp = y + z;
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9.2e-164: tmp = x + z elif x <= 1.8e-83: tmp = y + z else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9.2e-164) tmp = Float64(x + z); elseif (x <= 1.8e-83) tmp = Float64(y + z); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9.2e-164) tmp = x + z; elseif (x <= 1.8e-83) tmp = y + z; else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9.2e-164], N[(x + z), $MachinePrecision], If[LessEqual[x, 1.8e-83], N[(y + z), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{-164}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-83}:\\
\;\;\;\;y + z\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if x < -9.19999999999999942e-164 or 1.80000000000000006e-83 < x Initial program 99.9%
Taylor expanded in x around inf 91.9%
Taylor expanded in y around 0 80.4%
if -9.19999999999999942e-164 < x < 1.80000000000000006e-83Initial program 99.9%
Taylor expanded in x around 0 95.3%
Taylor expanded in y around 0 57.9%
+-commutative57.9%
Simplified57.9%
Final simplification74.6%
(FPCore (x y z) :precision binary64 (+ x z))
double code(double x, double y, double z) {
return x + z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + z
end function
public static double code(double x, double y, double z) {
return x + z;
}
def code(x, y, z): return x + z
function code(x, y, z) return Float64(x + z) end
function tmp = code(x, y, z) tmp = x + z; end
code[x_, y_, z_] := N[(x + z), $MachinePrecision]
\begin{array}{l}
\\
x + z
\end{array}
Initial program 99.9%
Taylor expanded in x around inf 84.1%
Taylor expanded in y around 0 70.4%
Final simplification70.4%
(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 84.1%
Taylor expanded in x around inf 46.3%
Final simplification46.3%
herbie shell --seed 2023228
(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))))