
(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 -9e+162)
t_0
(if (<= z -1.7e-10)
(+ x z)
(if (<= z 4.1e-23) (+ x (sin y)) (if (<= z 2.4e+146) (+ x z) t_0))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -9e+162) {
tmp = t_0;
} else if (z <= -1.7e-10) {
tmp = x + z;
} else if (z <= 4.1e-23) {
tmp = x + sin(y);
} else if (z <= 2.4e+146) {
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 <= (-9d+162)) then
tmp = t_0
else if (z <= (-1.7d-10)) then
tmp = x + z
else if (z <= 4.1d-23) then
tmp = x + sin(y)
else if (z <= 2.4d+146) 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 <= -9e+162) {
tmp = t_0;
} else if (z <= -1.7e-10) {
tmp = x + z;
} else if (z <= 4.1e-23) {
tmp = x + Math.sin(y);
} else if (z <= 2.4e+146) {
tmp = x + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -9e+162: tmp = t_0 elif z <= -1.7e-10: tmp = x + z elif z <= 4.1e-23: tmp = x + math.sin(y) elif z <= 2.4e+146: 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 <= -9e+162) tmp = t_0; elseif (z <= -1.7e-10) tmp = Float64(x + z); elseif (z <= 4.1e-23) tmp = Float64(x + sin(y)); elseif (z <= 2.4e+146) 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 <= -9e+162) tmp = t_0; elseif (z <= -1.7e-10) tmp = x + z; elseif (z <= 4.1e-23) tmp = x + sin(y); elseif (z <= 2.4e+146) 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, -9e+162], t$95$0, If[LessEqual[z, -1.7e-10], N[(x + z), $MachinePrecision], If[LessEqual[z, 4.1e-23], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+146], N[(x + z), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -9 \cdot 10^{+162}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-10}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-23}:\\
\;\;\;\;x + \sin y\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+146}:\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -8.99999999999999944e162 or 2.4000000000000002e146 < z Initial program 99.8%
+-commutative99.8%
fma-define99.7%
Simplified99.7%
Taylor expanded in z around inf 85.6%
if -8.99999999999999944e162 < z < -1.70000000000000007e-10 or 4.10000000000000029e-23 < z < 2.4000000000000002e146Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 81.3%
if -1.70000000000000007e-10 < z < 4.10000000000000029e-23Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around 0 94.2%
+-commutative94.2%
Simplified94.2%
Final simplification88.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.000135) (not (<= z 2.45e-23))) (+ x (* z (cos y))) (+ x (sin y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.000135) || !(z <= 2.45e-23)) {
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.000135d0)) .or. (.not. (z <= 2.45d-23))) 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.000135) || !(z <= 2.45e-23)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = x + Math.sin(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.000135) or not (z <= 2.45e-23): 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.000135) || !(z <= 2.45e-23)) 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.000135) || ~((z <= 2.45e-23))) tmp = x + (z * cos(y)); else tmp = x + sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.000135], N[Not[LessEqual[z, 2.45e-23]], $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.000135 \lor \neg \left(z \leq 2.45 \cdot 10^{-23}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \sin y\\
\end{array}
\end{array}
if z < -1.35000000000000002e-4 or 2.4499999999999999e-23 < z Initial program 99.8%
Taylor expanded in x around inf 99.2%
if -1.35000000000000002e-4 < z < 2.4499999999999999e-23Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around 0 94.2%
+-commutative94.2%
Simplified94.2%
Final simplification96.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -4.6e-9) (not (<= x 2.1e-124))) (+ x z) (* z (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -4.6e-9) || !(x <= 2.1e-124)) {
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 <= (-4.6d-9)) .or. (.not. (x <= 2.1d-124))) 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 <= -4.6e-9) || !(x <= 2.1e-124)) {
tmp = x + z;
} else {
tmp = z * Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -4.6e-9) or not (x <= 2.1e-124): tmp = x + z else: tmp = z * math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -4.6e-9) || !(x <= 2.1e-124)) 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 <= -4.6e-9) || ~((x <= 2.1e-124))) tmp = x + z; else tmp = z * cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -4.6e-9], N[Not[LessEqual[x, 2.1e-124]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-9} \lor \neg \left(x \leq 2.1 \cdot 10^{-124}\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;z \cdot \cos y\\
\end{array}
\end{array}
if x < -4.5999999999999998e-9 or 2.1000000000000001e-124 < x Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 83.8%
if -4.5999999999999998e-9 < x < 2.1000000000000001e-124Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 63.0%
Final simplification75.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -600000000000.0) (not (<= y 23.5))) (+ 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 <= -600000000000.0) || !(y <= 23.5)) {
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 <= (-600000000000.0d0)) .or. (.not. (y <= 23.5d0))) 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 <= -600000000000.0) || !(y <= 23.5)) {
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 <= -600000000000.0) or not (y <= 23.5): 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 <= -600000000000.0) || !(y <= 23.5)) 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 <= -600000000000.0) || ~((y <= 23.5))) 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, -600000000000.0], N[Not[LessEqual[y, 23.5]], $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 -600000000000 \lor \neg \left(y \leq 23.5\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 < -6e11 or 23.5 < y Initial program 99.8%
+-commutative99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around 0 47.2%
if -6e11 < y < 23.5Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around 0 99.3%
Final simplification73.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -850000000000.0) (not (<= y 23.5))) (+ x z) (+ (+ x z) (* y (+ 1.0 (* -0.5 (* y z)))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -850000000000.0) || !(y <= 23.5)) {
tmp = x + z;
} else {
tmp = (x + z) + (y * (1.0 + (-0.5 * (y * 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 <= (-850000000000.0d0)) .or. (.not. (y <= 23.5d0))) then
tmp = x + z
else
tmp = (x + z) + (y * (1.0d0 + ((-0.5d0) * (y * z))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -850000000000.0) || !(y <= 23.5)) {
tmp = x + z;
} else {
tmp = (x + z) + (y * (1.0 + (-0.5 * (y * z))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -850000000000.0) or not (y <= 23.5): tmp = x + z else: tmp = (x + z) + (y * (1.0 + (-0.5 * (y * z)))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -850000000000.0) || !(y <= 23.5)) tmp = Float64(x + z); else tmp = Float64(Float64(x + z) + Float64(y * Float64(1.0 + Float64(-0.5 * Float64(y * z))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -850000000000.0) || ~((y <= 23.5))) tmp = x + z; else tmp = (x + z) + (y * (1.0 + (-0.5 * (y * z)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -850000000000.0], N[Not[LessEqual[y, 23.5]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(N[(x + z), $MachinePrecision] + N[(y * N[(1.0 + N[(-0.5 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -850000000000 \lor \neg \left(y \leq 23.5\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;\left(x + z\right) + y \cdot \left(1 + -0.5 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if y < -8.5e11 or 23.5 < y Initial program 99.8%
+-commutative99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around 0 47.2%
if -8.5e11 < y < 23.5Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around 0 98.7%
associate-+r+98.7%
Simplified98.7%
Final simplification72.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -4e+35) (not (<= y 1.8))) (+ x z) (+ z (+ x y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4e+35) || !(y <= 1.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 <= (-4d+35)) .or. (.not. (y <= 1.8d0))) 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 <= -4e+35) || !(y <= 1.8)) {
tmp = x + z;
} else {
tmp = z + (x + y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4e+35) or not (y <= 1.8): tmp = x + z else: tmp = z + (x + y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4e+35) || !(y <= 1.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 <= -4e+35) || ~((y <= 1.8))) tmp = x + z; else tmp = z + (x + y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4e+35], N[Not[LessEqual[y, 1.8]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+35} \lor \neg \left(y \leq 1.8\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;z + \left(x + y\right)\\
\end{array}
\end{array}
if y < -3.9999999999999999e35 or 1.80000000000000004 < y Initial program 99.8%
+-commutative99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around 0 47.0%
if -3.9999999999999999e35 < y < 1.80000000000000004Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around 0 97.6%
associate-+r+97.6%
+-commutative97.6%
Simplified97.6%
Final simplification72.9%
(FPCore (x y z) :precision binary64 (if (<= x -9500.0) x (if (<= x 6e-126) z x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -9500.0) {
tmp = x;
} else if (x <= 6e-126) {
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 <= (-9500.0d0)) then
tmp = x
else if (x <= 6d-126) 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 <= -9500.0) {
tmp = x;
} else if (x <= 6e-126) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9500.0: tmp = x elif x <= 6e-126: tmp = z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9500.0) tmp = x; elseif (x <= 6e-126) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9500.0) tmp = x; elseif (x <= 6e-126) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9500.0], x, If[LessEqual[x, 6e-126], z, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9500:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-126}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9500 or 6.0000000000000003e-126 < x Initial program 99.9%
add-log-exp99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 73.2%
if -9500 < x < 6.0000000000000003e-126Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 64.5%
Taylor expanded in y around 0 44.9%
(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%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 68.6%
(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%
add-log-exp99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 45.5%
herbie shell --seed 2024180
(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))))