
(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 (+ (* 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 -1.5e+137)
t_0
(if (<= z -1.95e+68)
(+ x z)
(if (or (<= z -0.072) (not (<= z 1.6e+18))) t_0 (+ x (sin y)))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -1.5e+137) {
tmp = t_0;
} else if (z <= -1.95e+68) {
tmp = x + z;
} else if ((z <= -0.072) || !(z <= 1.6e+18)) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = z * cos(y)
if (z <= (-1.5d+137)) then
tmp = t_0
else if (z <= (-1.95d+68)) then
tmp = x + z
else if ((z <= (-0.072d0)) .or. (.not. (z <= 1.6d+18))) then
tmp = t_0
else
tmp = x + sin(y)
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.5e+137) {
tmp = t_0;
} else if (z <= -1.95e+68) {
tmp = x + z;
} else if ((z <= -0.072) || !(z <= 1.6e+18)) {
tmp = t_0;
} else {
tmp = x + Math.sin(y);
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -1.5e+137: tmp = t_0 elif z <= -1.95e+68: tmp = x + z elif (z <= -0.072) or not (z <= 1.6e+18): tmp = t_0 else: tmp = x + math.sin(y) return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -1.5e+137) tmp = t_0; elseif (z <= -1.95e+68) tmp = Float64(x + z); elseif ((z <= -0.072) || !(z <= 1.6e+18)) tmp = t_0; else tmp = Float64(x + sin(y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if (z <= -1.5e+137) tmp = t_0; elseif (z <= -1.95e+68) tmp = x + z; elseif ((z <= -0.072) || ~((z <= 1.6e+18))) tmp = t_0; else tmp = x + sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+137], t$95$0, If[LessEqual[z, -1.95e+68], N[(x + z), $MachinePrecision], If[Or[LessEqual[z, -0.072], N[Not[LessEqual[z, 1.6e+18]], $MachinePrecision]], t$95$0, N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+137}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{+68}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;z \leq -0.072 \lor \neg \left(z \leq 1.6 \cdot 10^{+18}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x + \sin y\\
\end{array}
\end{array}
if z < -1.5e137 or -1.95000000000000009e68 < z < -0.0719999999999999946 or 1.6e18 < z Initial program 99.9%
Taylor expanded in z around inf 82.6%
if -1.5e137 < z < -1.95000000000000009e68Initial program 100.0%
Taylor expanded in y around 0 84.7%
+-commutative84.7%
Simplified84.7%
if -0.0719999999999999946 < z < 1.6e18Initial program 100.0%
Taylor expanded in z around 0 91.1%
+-commutative91.1%
Simplified91.1%
Final simplification87.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.034) (not (<= z 5.9e-12))) (+ x (* z (cos y))) (+ x (sin y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.034) || !(z <= 5.9e-12)) {
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.034d0)) .or. (.not. (z <= 5.9d-12))) 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.034) || !(z <= 5.9e-12)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = x + Math.sin(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.034) or not (z <= 5.9e-12): 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.034) || !(z <= 5.9e-12)) 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.034) || ~((z <= 5.9e-12))) tmp = x + (z * cos(y)); else tmp = x + sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.034], N[Not[LessEqual[z, 5.9e-12]], $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.034 \lor \neg \left(z \leq 5.9 \cdot 10^{-12}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \sin y\\
\end{array}
\end{array}
if z < -0.034000000000000002 or 5.9e-12 < z Initial program 99.9%
Taylor expanded in x around inf 99.3%
if -0.034000000000000002 < z < 5.9e-12Initial program 100.0%
Taylor expanded in z around 0 91.6%
+-commutative91.6%
Simplified91.6%
Final simplification95.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.75) (not (<= z 3e-11))) (+ x (* z (cos y))) (+ z (+ x (sin y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.75) || !(z <= 3e-11)) {
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 <= (-0.75d0)) .or. (.not. (z <= 3d-11))) 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 <= -0.75) || !(z <= 3e-11)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = z + (x + Math.sin(y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.75) or not (z <= 3e-11): 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 <= -0.75) || !(z <= 3e-11)) 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 <= -0.75) || ~((z <= 3e-11))) tmp = x + (z * cos(y)); else tmp = z + (x + sin(y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.75], N[Not[LessEqual[z, 3e-11]], $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 -0.75 \lor \neg \left(z \leq 3 \cdot 10^{-11}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;z + \left(x + \sin y\right)\\
\end{array}
\end{array}
if z < -0.75 or 3e-11 < z Initial program 99.9%
Taylor expanded in x around inf 99.3%
if -0.75 < z < 3e-11Initial program 100.0%
Taylor expanded in y around 0 99.2%
Final simplification99.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -2300000000.0) (not (<= x 2.2e-14))) (+ x z) (* z (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2300000000.0) || !(x <= 2.2e-14)) {
tmp = x + z;
} else {
tmp = 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 <= (-2300000000.0d0)) .or. (.not. (x <= 2.2d-14))) then
tmp = x + z
else
tmp = z * cos(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2300000000.0) || !(x <= 2.2e-14)) {
tmp = x + z;
} else {
tmp = z * Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2300000000.0) or not (x <= 2.2e-14): tmp = x + z else: tmp = z * math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2300000000.0) || !(x <= 2.2e-14)) tmp = Float64(x + z); else tmp = Float64(z * cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2300000000.0) || ~((x <= 2.2e-14))) tmp = x + z; else tmp = z * cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2300000000.0], N[Not[LessEqual[x, 2.2e-14]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2300000000 \lor \neg \left(x \leq 2.2 \cdot 10^{-14}\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;z \cdot \cos y\\
\end{array}
\end{array}
if x < -2.3e9 or 2.2000000000000001e-14 < x Initial program 100.0%
Taylor expanded in y around 0 90.8%
+-commutative90.8%
Simplified90.8%
if -2.3e9 < x < 2.2000000000000001e-14Initial program 99.9%
Taylor expanded in z around inf 64.6%
Final simplification77.7%
(FPCore (x y z) :precision binary64 (if (<= y -7000000.0) (+ x z) (if (<= y 7.6e+66) (+ z (+ x y)) (sin y))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7000000.0) {
tmp = x + z;
} else if (y <= 7.6e+66) {
tmp = z + (x + y);
} else {
tmp = 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 (y <= (-7000000.0d0)) then
tmp = x + z
else if (y <= 7.6d+66) then
tmp = z + (x + y)
else
tmp = sin(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7000000.0) {
tmp = x + z;
} else if (y <= 7.6e+66) {
tmp = z + (x + y);
} else {
tmp = Math.sin(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7000000.0: tmp = x + z elif y <= 7.6e+66: tmp = z + (x + y) else: tmp = math.sin(y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7000000.0) tmp = Float64(x + z); elseif (y <= 7.6e+66) tmp = Float64(z + Float64(x + y)); else tmp = sin(y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7000000.0) tmp = x + z; elseif (y <= 7.6e+66) tmp = z + (x + y); else tmp = sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7000000.0], N[(x + z), $MachinePrecision], If[LessEqual[y, 7.6e+66], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision], N[Sin[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7000000:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+66}:\\
\;\;\;\;z + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;\sin y\\
\end{array}
\end{array}
if y < -7e6Initial program 99.8%
Taylor expanded in y around 0 47.7%
+-commutative47.7%
Simplified47.7%
if -7e6 < y < 7.6000000000000004e66Initial program 100.0%
Taylor expanded in y around 0 92.2%
+-commutative92.2%
+-commutative92.2%
associate-+l+92.2%
Simplified92.2%
if 7.6000000000000004e66 < y Initial program 99.9%
Taylor expanded in x around 0 75.8%
Taylor expanded in z around 0 34.4%
Final simplification69.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -1900000.0) (not (<= y 5.5e-8))) (+ x z) (+ z (+ x y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1900000.0) || !(y <= 5.5e-8)) {
tmp = x + z;
} else {
tmp = z + (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 <= (-1900000.0d0)) .or. (.not. (y <= 5.5d-8))) then
tmp = x + z
else
tmp = z + (x + y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1900000.0) || !(y <= 5.5e-8)) {
tmp = x + z;
} else {
tmp = z + (x + y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1900000.0) or not (y <= 5.5e-8): tmp = x + z else: tmp = z + (x + y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1900000.0) || !(y <= 5.5e-8)) tmp = Float64(x + z); else tmp = Float64(z + Float64(x + y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1900000.0) || ~((y <= 5.5e-8))) tmp = x + z; else tmp = z + (x + y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1900000.0], N[Not[LessEqual[y, 5.5e-8]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1900000 \lor \neg \left(y \leq 5.5 \cdot 10^{-8}\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;z + \left(x + y\right)\\
\end{array}
\end{array}
if y < -1.9e6 or 5.5000000000000003e-8 < y Initial program 99.9%
Taylor expanded in y around 0 41.0%
+-commutative41.0%
Simplified41.0%
if -1.9e6 < y < 5.5000000000000003e-8Initial program 100.0%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
+-commutative99.2%
associate-+l+99.2%
Simplified99.2%
Final simplification69.2%
(FPCore (x y z) :precision binary64 (if (<= x -1.25e+14) x (if (<= x 14800000.0) (+ y z) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.25e+14) {
tmp = x;
} else if (x <= 14800000.0) {
tmp = y + z;
} 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.25d+14)) then
tmp = x
else if (x <= 14800000.0d0) then
tmp = y + z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.25e+14) {
tmp = x;
} else if (x <= 14800000.0) {
tmp = y + z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.25e+14: tmp = x elif x <= 14800000.0: tmp = y + z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.25e+14) tmp = x; elseif (x <= 14800000.0) tmp = Float64(y + z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.25e+14) tmp = x; elseif (x <= 14800000.0) tmp = y + z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.25e+14], x, If[LessEqual[x, 14800000.0], N[(y + z), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 14800000:\\
\;\;\;\;y + z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.25e14 or 1.48e7 < x Initial program 100.0%
+-commutative100.0%
*-commutative100.0%
add-cube-cbrt99.9%
associate-*l*99.9%
fma-define99.9%
pow299.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 77.5%
if -1.25e14 < x < 1.48e7Initial program 99.9%
Taylor expanded in x around 0 92.9%
Taylor expanded in y around 0 40.9%
Final simplification58.3%
(FPCore (x y z) :precision binary64 (if (<= x -1.25e+14) x (if (<= x 11000000000.0) z x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.25e+14) {
tmp = x;
} else if (x <= 11000000000.0) {
tmp = z;
} 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.25d+14)) then
tmp = x
else if (x <= 11000000000.0d0) then
tmp = z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.25e+14) {
tmp = x;
} else if (x <= 11000000000.0) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.25e+14: tmp = x elif x <= 11000000000.0: tmp = z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.25e+14) tmp = x; elseif (x <= 11000000000.0) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.25e+14) tmp = x; elseif (x <= 11000000000.0) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.25e+14], x, If[LessEqual[x, 11000000000.0], z, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 11000000000:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.25e14 or 1.1e10 < x Initial program 100.0%
+-commutative100.0%
*-commutative100.0%
add-cube-cbrt99.9%
associate-*l*99.9%
fma-define99.9%
pow299.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 77.5%
if -1.25e14 < x < 1.1e10Initial program 99.9%
Taylor expanded in z around inf 63.8%
Taylor expanded in y around 0 36.5%
Final simplification56.1%
(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 y around 0 65.7%
+-commutative65.7%
Simplified65.7%
Final simplification65.7%
(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%
+-commutative99.9%
*-commutative99.9%
add-cube-cbrt99.7%
associate-*l*99.7%
fma-define99.6%
pow299.6%
Applied egg-rr99.6%
Taylor expanded in x around inf 41.0%
Final simplification41.0%
herbie shell --seed 2024044
(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))))