
(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 (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-define100.0%
Simplified100.0%
Final simplification100.0%
(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 (<= y -1.9e+194)
(+ z x)
(if (<= y -1.18e+48)
t_0
(if (<= y 2e+27)
(+ z (+ y x))
(if (or (<= y 4.5e+286) (not (<= y 7.5e+304))) t_0 (+ z x)))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (y <= -1.9e+194) {
tmp = z + x;
} else if (y <= -1.18e+48) {
tmp = t_0;
} else if (y <= 2e+27) {
tmp = z + (y + x);
} else if ((y <= 4.5e+286) || !(y <= 7.5e+304)) {
tmp = t_0;
} else {
tmp = 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) :: t_0
real(8) :: tmp
t_0 = z * cos(y)
if (y <= (-1.9d+194)) then
tmp = z + x
else if (y <= (-1.18d+48)) then
tmp = t_0
else if (y <= 2d+27) then
tmp = z + (y + x)
else if ((y <= 4.5d+286) .or. (.not. (y <= 7.5d+304))) then
tmp = t_0
else
tmp = z + x
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 (y <= -1.9e+194) {
tmp = z + x;
} else if (y <= -1.18e+48) {
tmp = t_0;
} else if (y <= 2e+27) {
tmp = z + (y + x);
} else if ((y <= 4.5e+286) || !(y <= 7.5e+304)) {
tmp = t_0;
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if y <= -1.9e+194: tmp = z + x elif y <= -1.18e+48: tmp = t_0 elif y <= 2e+27: tmp = z + (y + x) elif (y <= 4.5e+286) or not (y <= 7.5e+304): tmp = t_0 else: tmp = z + x return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (y <= -1.9e+194) tmp = Float64(z + x); elseif (y <= -1.18e+48) tmp = t_0; elseif (y <= 2e+27) tmp = Float64(z + Float64(y + x)); elseif ((y <= 4.5e+286) || !(y <= 7.5e+304)) tmp = t_0; else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if (y <= -1.9e+194) tmp = z + x; elseif (y <= -1.18e+48) tmp = t_0; elseif (y <= 2e+27) tmp = z + (y + x); elseif ((y <= 4.5e+286) || ~((y <= 7.5e+304))) tmp = t_0; else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e+194], N[(z + x), $MachinePrecision], If[LessEqual[y, -1.18e+48], t$95$0, If[LessEqual[y, 2e+27], N[(z + N[(y + x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 4.5e+286], N[Not[LessEqual[y, 7.5e+304]], $MachinePrecision]], t$95$0, N[(z + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+194}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq -1.18 \cdot 10^{+48}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+27}:\\
\;\;\;\;z + \left(y + x\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+286} \lor \neg \left(y \leq 7.5 \cdot 10^{+304}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if y < -1.8999999999999999e194 or 4.4999999999999998e286 < y < 7.49999999999999954e304Initial program 99.9%
Taylor expanded in y around 0 53.5%
+-commutative53.5%
Simplified53.5%
if -1.8999999999999999e194 < y < -1.18000000000000007e48 or 2e27 < y < 4.4999999999999998e286 or 7.49999999999999954e304 < y Initial program 99.9%
Taylor expanded in z around inf 51.6%
if -1.18000000000000007e48 < y < 2e27Initial program 100.0%
Taylor expanded in y around 0 95.4%
+-commutative95.4%
+-commutative95.4%
associate-+l+95.4%
Simplified95.4%
Final simplification78.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -1.8e+150)
t_0
(if (<= z -2.1e+44)
(+ z x)
(if (<= z -5000000.0)
t_0
(if (<= z 1.5e-34)
(+ x (sin y))
(if (<= z 1.02e+129) (+ z x) t_0)))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -1.8e+150) {
tmp = t_0;
} else if (z <= -2.1e+44) {
tmp = z + x;
} else if (z <= -5000000.0) {
tmp = t_0;
} else if (z <= 1.5e-34) {
tmp = x + sin(y);
} else if (z <= 1.02e+129) {
tmp = z + 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 <= (-1.8d+150)) then
tmp = t_0
else if (z <= (-2.1d+44)) then
tmp = z + x
else if (z <= (-5000000.0d0)) then
tmp = t_0
else if (z <= 1.5d-34) then
tmp = x + sin(y)
else if (z <= 1.02d+129) then
tmp = z + 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 <= -1.8e+150) {
tmp = t_0;
} else if (z <= -2.1e+44) {
tmp = z + x;
} else if (z <= -5000000.0) {
tmp = t_0;
} else if (z <= 1.5e-34) {
tmp = x + Math.sin(y);
} else if (z <= 1.02e+129) {
tmp = z + x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -1.8e+150: tmp = t_0 elif z <= -2.1e+44: tmp = z + x elif z <= -5000000.0: tmp = t_0 elif z <= 1.5e-34: tmp = x + math.sin(y) elif z <= 1.02e+129: tmp = z + x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -1.8e+150) tmp = t_0; elseif (z <= -2.1e+44) tmp = Float64(z + x); elseif (z <= -5000000.0) tmp = t_0; elseif (z <= 1.5e-34) tmp = Float64(x + sin(y)); elseif (z <= 1.02e+129) tmp = Float64(z + 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 <= -1.8e+150) tmp = t_0; elseif (z <= -2.1e+44) tmp = z + x; elseif (z <= -5000000.0) tmp = t_0; elseif (z <= 1.5e-34) tmp = x + sin(y); elseif (z <= 1.02e+129) tmp = z + 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, -1.8e+150], t$95$0, If[LessEqual[z, -2.1e+44], N[(z + x), $MachinePrecision], If[LessEqual[z, -5000000.0], t$95$0, If[LessEqual[z, 1.5e-34], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+129], N[(z + x), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+150}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{+44}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;z \leq -5000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-34}:\\
\;\;\;\;x + \sin y\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+129}:\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.79999999999999993e150 or -2.09999999999999987e44 < z < -5e6 or 1.01999999999999996e129 < z Initial program 99.9%
Taylor expanded in z around inf 84.0%
if -1.79999999999999993e150 < z < -2.09999999999999987e44 or 1.5e-34 < z < 1.01999999999999996e129Initial program 99.9%
Taylor expanded in y around 0 82.5%
+-commutative82.5%
Simplified82.5%
if -5e6 < z < 1.5e-34Initial program 100.0%
Taylor expanded in z around 0 93.1%
+-commutative93.1%
Simplified93.1%
Final simplification88.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.35e-76) (not (<= z 1.45e-34))) (+ x (* z (cos y))) (+ x (sin y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.35e-76) || !(z <= 1.45e-34)) {
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 <= (-1.35d-76)) .or. (.not. (z <= 1.45d-34))) 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 <= -1.35e-76) || !(z <= 1.45e-34)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = x + Math.sin(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.35e-76) or not (z <= 1.45e-34): tmp = x + (z * math.cos(y)) else: tmp = x + math.sin(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.35e-76) || !(z <= 1.45e-34)) 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 <= -1.35e-76) || ~((z <= 1.45e-34))) tmp = x + (z * cos(y)); else tmp = x + sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.35e-76], N[Not[LessEqual[z, 1.45e-34]], $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 -1.35 \cdot 10^{-76} \lor \neg \left(z \leq 1.45 \cdot 10^{-34}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \sin y\\
\end{array}
\end{array}
if z < -1.35e-76 or 1.4500000000000001e-34 < z Initial program 99.9%
Taylor expanded in x around inf 77.4%
associate-+r+77.4%
associate-/l*77.3%
Simplified77.3%
associate-+l+77.3%
distribute-rgt-in77.3%
*-un-lft-identity77.3%
clear-num77.3%
un-div-inv77.4%
Applied egg-rr77.4%
Taylor expanded in z around inf 97.1%
if -1.35e-76 < z < 1.4500000000000001e-34Initial program 100.0%
Taylor expanded in z around 0 95.6%
+-commutative95.6%
Simplified95.6%
Final simplification96.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.5) (not (<= y 1.2e+16))) (+ z x) (+ (+ z x) (* y (+ 1.0 (* -0.5 (* z y)))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.5) || !(y <= 1.2e+16)) {
tmp = z + x;
} else {
tmp = (z + x) + (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 <= (-3.5d0)) .or. (.not. (y <= 1.2d+16))) then
tmp = z + x
else
tmp = (z + x) + (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 <= -3.5) || !(y <= 1.2e+16)) {
tmp = z + x;
} else {
tmp = (z + x) + (y * (1.0 + (-0.5 * (z * y))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.5) or not (y <= 1.2e+16): tmp = z + x else: tmp = (z + x) + (y * (1.0 + (-0.5 * (z * y)))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.5) || !(y <= 1.2e+16)) tmp = Float64(z + x); else tmp = Float64(Float64(z + x) + 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 <= -3.5) || ~((y <= 1.2e+16))) tmp = z + x; else tmp = (z + x) + (y * (1.0 + (-0.5 * (z * y)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.5], N[Not[LessEqual[y, 1.2e+16]], $MachinePrecision]], N[(z + x), $MachinePrecision], N[(N[(z + x), $MachinePrecision] + N[(y * N[(1.0 + N[(-0.5 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \lor \neg \left(y \leq 1.2 \cdot 10^{+16}\right):\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;\left(z + x\right) + y \cdot \left(1 + -0.5 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if y < -3.5 or 1.2e16 < y Initial program 99.9%
Taylor expanded in y around 0 35.6%
+-commutative35.6%
Simplified35.6%
if -3.5 < y < 1.2e16Initial program 100.0%
Taylor expanded in y around 0 98.8%
associate-+r+98.8%
+-commutative98.8%
*-commutative98.8%
Simplified98.8%
Final simplification71.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.25e+32) (not (<= y 5.8e+107))) (+ z x) (+ z (+ y x))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.25e+32) || !(y <= 5.8e+107)) {
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 <= (-1.25d+32)) .or. (.not. (y <= 5.8d+107))) 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 <= -1.25e+32) || !(y <= 5.8e+107)) {
tmp = z + x;
} else {
tmp = z + (y + x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.25e+32) or not (y <= 5.8e+107): tmp = z + x else: tmp = z + (y + x) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.25e+32) || !(y <= 5.8e+107)) 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 <= -1.25e+32) || ~((y <= 5.8e+107))) tmp = z + x; else tmp = z + (y + x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.25e+32], N[Not[LessEqual[y, 5.8e+107]], $MachinePrecision]], N[(z + x), $MachinePrecision], N[(z + N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+32} \lor \neg \left(y \leq 5.8 \cdot 10^{+107}\right):\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;z + \left(y + x\right)\\
\end{array}
\end{array}
if y < -1.2499999999999999e32 or 5.79999999999999975e107 < y Initial program 99.9%
Taylor expanded in y around 0 36.7%
+-commutative36.7%
Simplified36.7%
if -1.2499999999999999e32 < y < 5.79999999999999975e107Initial program 100.0%
Taylor expanded in y around 0 91.0%
+-commutative91.0%
+-commutative91.0%
associate-+l+91.0%
Simplified91.0%
Final simplification71.5%
(FPCore (x y z) :precision binary64 (if (<= y -165.0) x (if (<= y 8.2e+196) (+ y x) x)))
double code(double x, double y, double z) {
double tmp;
if (y <= -165.0) {
tmp = x;
} else if (y <= 8.2e+196) {
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 <= (-165.0d0)) then
tmp = x
else if (y <= 8.2d+196) 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 <= -165.0) {
tmp = x;
} else if (y <= 8.2e+196) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -165.0: tmp = x elif y <= 8.2e+196: tmp = y + x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -165.0) tmp = x; elseif (y <= 8.2e+196) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -165.0) tmp = x; elseif (y <= 8.2e+196) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -165.0], x, If[LessEqual[y, 8.2e+196], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -165:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+196}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -165 or 8.1999999999999993e196 < y Initial program 99.9%
Taylor expanded in x around inf 37.8%
if -165 < y < 8.1999999999999993e196Initial program 100.0%
Taylor expanded in x around inf 88.6%
associate-+r+88.6%
associate-/l*88.5%
Simplified88.5%
associate-+l+88.5%
distribute-rgt-in88.5%
*-un-lft-identity88.5%
clear-num88.5%
un-div-inv88.6%
Applied egg-rr88.6%
Taylor expanded in y around 0 80.2%
Taylor expanded in y around inf 58.7%
Final simplification51.9%
(FPCore (x y z) :precision binary64 (+ z x))
double code(double x, double y, double z) {
return 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 = z + x
end function
public static double code(double x, double y, double z) {
return z + x;
}
def code(x, y, z): return z + x
function code(x, y, z) return Float64(z + x) end
function tmp = code(x, y, z) tmp = z + x; end
code[x_, y_, z_] := N[(z + x), $MachinePrecision]
\begin{array}{l}
\\
z + x
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 65.5%
+-commutative65.5%
Simplified65.5%
Final simplification65.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%
Taylor expanded in x around inf 46.2%
Final simplification46.2%
herbie shell --seed 2024066
(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))))