
(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 (+ x (fma z (cos y) (sin y))))
double code(double x, double y, double z) {
return x + fma(z, cos(y), sin(y));
}
function code(x, y, z) return Float64(x + fma(z, cos(y), sin(y))) end
code[x_, y_, z_] := N[(x + N[(z * N[Cos[y], $MachinePrecision] + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \mathsf{fma}\left(z, \cos y, \sin y\right)
\end{array}
Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* z (cos y)))) (if (or (<= x -9.25e-21) (not (<= x 2.5e-45))) (+ x t_0) (+ (sin y) t_0))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if ((x <= -9.25e-21) || !(x <= 2.5e-45)) {
tmp = x + t_0;
} else {
tmp = sin(y) + 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 ((x <= (-9.25d-21)) .or. (.not. (x <= 2.5d-45))) then
tmp = x + t_0
else
tmp = sin(y) + 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 ((x <= -9.25e-21) || !(x <= 2.5e-45)) {
tmp = x + t_0;
} else {
tmp = Math.sin(y) + t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if (x <= -9.25e-21) or not (x <= 2.5e-45): tmp = x + t_0 else: tmp = math.sin(y) + t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if ((x <= -9.25e-21) || !(x <= 2.5e-45)) tmp = Float64(x + t_0); else tmp = Float64(sin(y) + t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if ((x <= -9.25e-21) || ~((x <= 2.5e-45))) tmp = x + t_0; else tmp = sin(y) + t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -9.25e-21], N[Not[LessEqual[x, 2.5e-45]], $MachinePrecision]], N[(x + t$95$0), $MachinePrecision], N[(N[Sin[y], $MachinePrecision] + t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;x \leq -9.25 \cdot 10^{-21} \lor \neg \left(x \leq 2.5 \cdot 10^{-45}\right):\\
\;\;\;\;x + t\_0\\
\mathbf{else}:\\
\;\;\;\;\sin y + t\_0\\
\end{array}
\end{array}
if x < -9.2500000000000001e-21 or 2.49999999999999988e-45 < x Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 98.5%
if -9.2500000000000001e-21 < x < 2.49999999999999988e-45Initial program 99.9%
expm1-log1p-u69.3%
expm1-undefine62.0%
Applied egg-rr62.0%
expm1-define69.3%
Simplified69.3%
Taylor expanded in x around 0 98.2%
Final simplification98.4%
(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 (if (or (<= z -5.5e-27) (not (<= z 1.9e-16))) (+ x (* z (cos y))) (+ x (sin y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5e-27) || !(z <= 1.9e-16)) {
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 <= (-5.5d-27)) .or. (.not. (z <= 1.9d-16))) 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 <= -5.5e-27) || !(z <= 1.9e-16)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = x + Math.sin(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.5e-27) or not (z <= 1.9e-16): tmp = x + (z * math.cos(y)) else: tmp = x + math.sin(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.5e-27) || !(z <= 1.9e-16)) 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 <= -5.5e-27) || ~((z <= 1.9e-16))) tmp = x + (z * cos(y)); else tmp = x + sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.5e-27], N[Not[LessEqual[z, 1.9e-16]], $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 -5.5 \cdot 10^{-27} \lor \neg \left(z \leq 1.9 \cdot 10^{-16}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \sin y\\
\end{array}
\end{array}
if z < -5.5000000000000002e-27 or 1.90000000000000006e-16 < z Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 97.5%
if -5.5000000000000002e-27 < z < 1.90000000000000006e-16Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around 0 94.7%
+-commutative94.7%
Simplified94.7%
Final simplification96.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.45) (not (<= y 0.0072))) (+ x (sin y)) (+ x (+ z (* y (+ 1.0 (* y (+ (* z -0.5) (* y -0.16666666666666666)))))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.45) || !(y <= 0.0072)) {
tmp = x + sin(y);
} else {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))));
}
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 <= (-0.45d0)) .or. (.not. (y <= 0.0072d0))) then
tmp = x + sin(y)
else
tmp = x + (z + (y * (1.0d0 + (y * ((z * (-0.5d0)) + (y * (-0.16666666666666666d0)))))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.45) || !(y <= 0.0072)) {
tmp = x + Math.sin(y);
} else {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.45) or not (y <= 0.0072): tmp = x + math.sin(y) else: tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.45) || !(y <= 0.0072)) tmp = Float64(x + sin(y)); else tmp = Float64(x + Float64(z + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(z * -0.5) + Float64(y * -0.16666666666666666))))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.45) || ~((y <= 0.0072))) tmp = x + sin(y); else tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.45], N[Not[LessEqual[y, 0.0072]], $MachinePrecision]], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], N[(x + N[(z + N[(y * N[(1.0 + N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.45 \lor \neg \left(y \leq 0.0072\right):\\
\;\;\;\;x + \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \left(z + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if y < -0.450000000000000011 or 0.0071999999999999998 < y Initial program 99.8%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in z around 0 58.7%
+-commutative58.7%
Simplified58.7%
if -0.450000000000000011 < y < 0.0071999999999999998Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around 0 99.9%
Final simplification78.5%
(FPCore (x y z) :precision binary64 (if (or (<= y -13500000000.0) (not (<= y 1.35e+14))) (+ x z) (+ x (+ z (* y (+ 1.0 (* y (+ (* z -0.5) (* y -0.16666666666666666)))))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -13500000000.0) || !(y <= 1.35e+14)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))));
}
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 <= (-13500000000.0d0)) .or. (.not. (y <= 1.35d+14))) then
tmp = x + z
else
tmp = x + (z + (y * (1.0d0 + (y * ((z * (-0.5d0)) + (y * (-0.16666666666666666d0)))))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -13500000000.0) || !(y <= 1.35e+14)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -13500000000.0) or not (y <= 1.35e+14): tmp = x + z else: tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -13500000000.0) || !(y <= 1.35e+14)) tmp = Float64(x + z); else tmp = Float64(x + Float64(z + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(z * -0.5) + Float64(y * -0.16666666666666666))))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -13500000000.0) || ~((y <= 1.35e+14))) tmp = x + z; else tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -13500000000.0], N[Not[LessEqual[y, 1.35e+14]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(x + N[(z + N[(y * N[(1.0 + N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -13500000000 \lor \neg \left(y \leq 1.35 \cdot 10^{+14}\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;x + \left(z + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if y < -1.35e10 or 1.35e14 < y Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 39.6%
+-commutative39.6%
Simplified39.6%
if -1.35e10 < y < 1.35e14Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around 0 98.2%
Final simplification68.5%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.5) (not (<= y 6.5e+18))) (+ x z) (+ x (+ z (* y (+ 1.0 (* -0.5 (* z y))))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.5) || !(y <= 6.5e+18)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (-0.5 * (z * 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.5d0)) .or. (.not. (y <= 6.5d+18))) then
tmp = x + z
else
tmp = x + (z + (y * (1.0d0 + ((-0.5d0) * (z * y)))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.5) || !(y <= 6.5e+18)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (-0.5 * (z * y)))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.5) or not (y <= 6.5e+18): tmp = x + z else: tmp = x + (z + (y * (1.0 + (-0.5 * (z * y))))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.5) || !(y <= 6.5e+18)) tmp = Float64(x + z); else tmp = Float64(x + Float64(z + Float64(y * Float64(1.0 + Float64(-0.5 * Float64(z * y)))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.5) || ~((y <= 6.5e+18))) tmp = x + z; else tmp = x + (z + (y * (1.0 + (-0.5 * (z * y))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.5], N[Not[LessEqual[y, 6.5e+18]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(x + N[(z + N[(y * N[(1.0 + N[(-0.5 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \lor \neg \left(y \leq 6.5 \cdot 10^{+18}\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;x + \left(z + y \cdot \left(1 + -0.5 \cdot \left(z \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if y < -1.5 or 6.5e18 < y Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 39.7%
+-commutative39.7%
Simplified39.7%
if -1.5 < y < 6.5e18Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around 0 97.9%
Final simplification68.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.2e+52) (not (<= y 2.45e+66))) (+ x z) (+ y (+ x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.2e+52) || !(y <= 2.45e+66)) {
tmp = x + z;
} else {
tmp = y + (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 <= (-3.2d+52)) .or. (.not. (y <= 2.45d+66))) then
tmp = x + z
else
tmp = y + (x + z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -3.2e+52) || !(y <= 2.45e+66)) {
tmp = x + z;
} else {
tmp = y + (x + z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.2e+52) or not (y <= 2.45e+66): tmp = x + z else: tmp = y + (x + z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.2e+52) || !(y <= 2.45e+66)) tmp = Float64(x + z); else tmp = Float64(y + Float64(x + z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3.2e+52) || ~((y <= 2.45e+66))) tmp = x + z; else tmp = y + (x + z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.2e+52], N[Not[LessEqual[y, 2.45e+66]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+52} \lor \neg \left(y \leq 2.45 \cdot 10^{+66}\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;y + \left(x + z\right)\\
\end{array}
\end{array}
if y < -3.2e52 or 2.44999999999999988e66 < y Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 39.9%
+-commutative39.9%
Simplified39.9%
if -3.2e52 < y < 2.44999999999999988e66Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 88.6%
+-commutative88.6%
associate-+l+88.6%
Simplified88.6%
Final simplification68.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.45e+53) (not (<= y 3e+66))) x (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.45e+53) || !(y <= 3e+66)) {
tmp = x;
} else {
tmp = x + 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.45d+53)) .or. (.not. (y <= 3d+66))) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.45e+53) || !(y <= 3e+66)) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.45e+53) or not (y <= 3e+66): tmp = x else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.45e+53) || !(y <= 3e+66)) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.45e+53) || ~((y <= 3e+66))) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.45e+53], N[Not[LessEqual[y, 3e+66]], $MachinePrecision]], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+53} \lor \neg \left(y \leq 3 \cdot 10^{+66}\right):\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -1.4500000000000001e53 or 3.00000000000000002e66 < y Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around inf 36.6%
if -1.4500000000000001e53 < y < 3.00000000000000002e66Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in y around 0 86.6%
Taylor expanded in z around 0 48.0%
Final simplification43.2%
(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%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 64.5%
+-commutative64.5%
Simplified64.5%
Final simplification64.5%
(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%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around inf 39.6%
herbie shell --seed 2024096
(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))))