
(FPCore (x y z) :precision binary64 (- (* x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x * cos(y)) - (z * 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 = (x * cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x * Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x * math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x * cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x * cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \cos y - z \cdot \sin y
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (- (* x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x * cos(y)) - (z * 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 = (x * cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x * Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x * math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x * cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x * cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \cos y - z \cdot \sin y
\end{array}
(FPCore (x y z) :precision binary64 (fma (sin y) (- z) (* x (cos y))))
double code(double x, double y, double z) {
return fma(sin(y), -z, (x * cos(y)));
}
function code(x, y, z) return fma(sin(y), Float64(-z), Float64(x * cos(y))) end
code[x_, y_, z_] := N[(N[Sin[y], $MachinePrecision] * (-z) + N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\sin y, -z, x \cdot \cos y\right)
\end{array}
Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (- (* x (cos y)) (* (sin y) z)))
double code(double x, double y, double z) {
return (x * cos(y)) - (sin(y) * 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 * cos(y)) - (sin(y) * z)
end function
public static double code(double x, double y, double z) {
return (x * Math.cos(y)) - (Math.sin(y) * z);
}
def code(x, y, z): return (x * math.cos(y)) - (math.sin(y) * z)
function code(x, y, z) return Float64(Float64(x * cos(y)) - Float64(sin(y) * z)) end
function tmp = code(x, y, z) tmp = (x * cos(y)) - (sin(y) * z); end
code[x_, y_, z_] := N[(N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \cos y - \sin y \cdot z
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (sin y) (- z))))
(if (<= y -3800000.0)
t_0
(if (<= y 0.00039)
(- x (* y z))
(if (or (<= y 4.8e+69) (not (<= y 2.7e+122))) t_0 (* x (cos y)))))))
double code(double x, double y, double z) {
double t_0 = sin(y) * -z;
double tmp;
if (y <= -3800000.0) {
tmp = t_0;
} else if (y <= 0.00039) {
tmp = x - (y * z);
} else if ((y <= 4.8e+69) || !(y <= 2.7e+122)) {
tmp = t_0;
} else {
tmp = x * 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) :: t_0
real(8) :: tmp
t_0 = sin(y) * -z
if (y <= (-3800000.0d0)) then
tmp = t_0
else if (y <= 0.00039d0) then
tmp = x - (y * z)
else if ((y <= 4.8d+69) .or. (.not. (y <= 2.7d+122))) then
tmp = t_0
else
tmp = x * cos(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.sin(y) * -z;
double tmp;
if (y <= -3800000.0) {
tmp = t_0;
} else if (y <= 0.00039) {
tmp = x - (y * z);
} else if ((y <= 4.8e+69) || !(y <= 2.7e+122)) {
tmp = t_0;
} else {
tmp = x * Math.cos(y);
}
return tmp;
}
def code(x, y, z): t_0 = math.sin(y) * -z tmp = 0 if y <= -3800000.0: tmp = t_0 elif y <= 0.00039: tmp = x - (y * z) elif (y <= 4.8e+69) or not (y <= 2.7e+122): tmp = t_0 else: tmp = x * math.cos(y) return tmp
function code(x, y, z) t_0 = Float64(sin(y) * Float64(-z)) tmp = 0.0 if (y <= -3800000.0) tmp = t_0; elseif (y <= 0.00039) tmp = Float64(x - Float64(y * z)); elseif ((y <= 4.8e+69) || !(y <= 2.7e+122)) tmp = t_0; else tmp = Float64(x * cos(y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = sin(y) * -z; tmp = 0.0; if (y <= -3800000.0) tmp = t_0; elseif (y <= 0.00039) tmp = x - (y * z); elseif ((y <= 4.8e+69) || ~((y <= 2.7e+122))) tmp = t_0; else tmp = x * cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision]}, If[LessEqual[y, -3800000.0], t$95$0, If[LessEqual[y, 0.00039], N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 4.8e+69], N[Not[LessEqual[y, 2.7e+122]], $MachinePrecision]], t$95$0, N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin y \cdot \left(-z\right)\\
\mathbf{if}\;y \leq -3800000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 0.00039:\\
\;\;\;\;x - y \cdot z\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+69} \lor \neg \left(y \leq 2.7 \cdot 10^{+122}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \cos y\\
\end{array}
\end{array}
if y < -3.8e6 or 3.89999999999999993e-4 < y < 4.8000000000000003e69 or 2.6999999999999998e122 < y Initial program 99.6%
Taylor expanded in x around 0 61.6%
mul-1-neg61.6%
*-commutative61.6%
distribute-rgt-neg-in61.6%
Simplified61.6%
if -3.8e6 < y < 3.89999999999999993e-4Initial program 100.0%
Taylor expanded in y around 0 98.2%
+-commutative98.2%
mul-1-neg98.2%
unsub-neg98.2%
Simplified98.2%
if 4.8000000000000003e69 < y < 2.6999999999999998e122Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
fma-def99.1%
Applied egg-rr99.1%
Taylor expanded in z around 0 85.9%
Final simplification82.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (sin y) (- z))))
(if (<= y -3800000.0)
t_0
(if (<= y 0.00096)
(fma (- y) z x)
(if (or (<= y 5.2e+69) (not (<= y 1.15e+111))) t_0 (* x (cos y)))))))
double code(double x, double y, double z) {
double t_0 = sin(y) * -z;
double tmp;
if (y <= -3800000.0) {
tmp = t_0;
} else if (y <= 0.00096) {
tmp = fma(-y, z, x);
} else if ((y <= 5.2e+69) || !(y <= 1.15e+111)) {
tmp = t_0;
} else {
tmp = x * cos(y);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(sin(y) * Float64(-z)) tmp = 0.0 if (y <= -3800000.0) tmp = t_0; elseif (y <= 0.00096) tmp = fma(Float64(-y), z, x); elseif ((y <= 5.2e+69) || !(y <= 1.15e+111)) tmp = t_0; else tmp = Float64(x * cos(y)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision]}, If[LessEqual[y, -3800000.0], t$95$0, If[LessEqual[y, 0.00096], N[((-y) * z + x), $MachinePrecision], If[Or[LessEqual[y, 5.2e+69], N[Not[LessEqual[y, 1.15e+111]], $MachinePrecision]], t$95$0, N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin y \cdot \left(-z\right)\\
\mathbf{if}\;y \leq -3800000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 0.00096:\\
\;\;\;\;\mathsf{fma}\left(-y, z, x\right)\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+69} \lor \neg \left(y \leq 1.15 \cdot 10^{+111}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \cos y\\
\end{array}
\end{array}
if y < -3.8e6 or 9.60000000000000024e-4 < y < 5.2000000000000004e69 or 1.15000000000000001e111 < y Initial program 99.6%
Taylor expanded in x around 0 61.6%
mul-1-neg61.6%
*-commutative61.6%
distribute-rgt-neg-in61.6%
Simplified61.6%
if -3.8e6 < y < 9.60000000000000024e-4Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 98.2%
associate-*r*98.2%
neg-mul-198.2%
fma-def98.2%
Simplified98.2%
if 5.2000000000000004e69 < y < 1.15000000000000001e111Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
fma-def99.1%
Applied egg-rr99.1%
Taylor expanded in z around 0 85.9%
Final simplification82.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.95e+50) (not (<= x 1.4e+108))) (* x (cos y)) (- x (* (sin y) z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.95e+50) || !(x <= 1.4e+108)) {
tmp = x * cos(y);
} else {
tmp = x - (sin(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 ((x <= (-1.95d+50)) .or. (.not. (x <= 1.4d+108))) then
tmp = x * cos(y)
else
tmp = x - (sin(y) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.95e+50) || !(x <= 1.4e+108)) {
tmp = x * Math.cos(y);
} else {
tmp = x - (Math.sin(y) * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.95e+50) or not (x <= 1.4e+108): tmp = x * math.cos(y) else: tmp = x - (math.sin(y) * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.95e+50) || !(x <= 1.4e+108)) tmp = Float64(x * cos(y)); else tmp = Float64(x - Float64(sin(y) * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.95e+50) || ~((x <= 1.4e+108))) tmp = x * cos(y); else tmp = x - (sin(y) * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.95e+50], N[Not[LessEqual[x, 1.4e+108]], $MachinePrecision]], N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{+50} \lor \neg \left(x \leq 1.4 \cdot 10^{+108}\right):\\
\;\;\;\;x \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x - \sin y \cdot z\\
\end{array}
\end{array}
if x < -1.94999999999999984e50 or 1.3999999999999999e108 < x Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 84.0%
if -1.94999999999999984e50 < x < 1.3999999999999999e108Initial program 99.8%
Taylor expanded in y around 0 89.7%
Final simplification87.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.0036) (not (<= y 0.00044))) (* x (cos y)) (- x (* y z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.0036) || !(y <= 0.00044)) {
tmp = x * cos(y);
} else {
tmp = x - (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 <= (-0.0036d0)) .or. (.not. (y <= 0.00044d0))) then
tmp = x * cos(y)
else
tmp = x - (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.0036) || !(y <= 0.00044)) {
tmp = x * Math.cos(y);
} else {
tmp = x - (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.0036) or not (y <= 0.00044): tmp = x * math.cos(y) else: tmp = x - (y * z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.0036) || !(y <= 0.00044)) tmp = Float64(x * cos(y)); else tmp = Float64(x - Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.0036) || ~((y <= 0.00044))) tmp = x * cos(y); else tmp = x - (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.0036], N[Not[LessEqual[y, 0.00044]], $MachinePrecision]], N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0036 \lor \neg \left(y \leq 0.00044\right):\\
\;\;\;\;x \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot z\\
\end{array}
\end{array}
if y < -0.0035999999999999999 or 4.40000000000000016e-4 < y Initial program 99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 44.8%
if -0.0035999999999999999 < y < 4.40000000000000016e-4Initial program 100.0%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
mul-1-neg99.7%
unsub-neg99.7%
Simplified99.7%
Final simplification74.1%
(FPCore (x y z) :precision binary64 (if (<= x -2.15e-63) x (if (<= x 6.6e-116) (* y (- z)) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.15e-63) {
tmp = x;
} else if (x <= 6.6e-116) {
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 <= (-2.15d-63)) then
tmp = x
else if (x <= 6.6d-116) 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 <= -2.15e-63) {
tmp = x;
} else if (x <= 6.6e-116) {
tmp = y * -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.15e-63: tmp = x elif x <= 6.6e-116: tmp = y * -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.15e-63) tmp = x; elseif (x <= 6.6e-116) tmp = Float64(y * Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.15e-63) tmp = x; elseif (x <= 6.6e-116) tmp = y * -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.15e-63], x, If[LessEqual[x, 6.6e-116], N[(y * (-z)), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{-63}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-116}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.1499999999999999e-63 or 6.60000000000000002e-116 < x Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 51.3%
if -2.1499999999999999e-63 < x < 6.60000000000000002e-116Initial program 99.8%
Taylor expanded in y around 0 51.6%
+-commutative51.6%
mul-1-neg51.6%
unsub-neg51.6%
Simplified51.6%
Taylor expanded in x around 0 44.0%
associate-*r*44.0%
neg-mul-144.0%
Simplified44.0%
Final simplification49.1%
(FPCore (x y z) :precision binary64 (if (<= x -1.95e-63) (+ x (* y z)) (if (<= x 3e-122) (* y (- z)) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.95e-63) {
tmp = x + (y * z);
} else if (x <= 3e-122) {
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.95d-63)) then
tmp = x + (y * z)
else if (x <= 3d-122) 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.95e-63) {
tmp = x + (y * z);
} else if (x <= 3e-122) {
tmp = y * -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.95e-63: tmp = x + (y * z) elif x <= 3e-122: tmp = y * -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.95e-63) tmp = Float64(x + Float64(y * z)); elseif (x <= 3e-122) tmp = Float64(y * Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.95e-63) tmp = x + (y * z); elseif (x <= 3e-122) tmp = y * -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.95e-63], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3e-122], N[(y * (-z)), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{-63}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-122}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.95000000000000011e-63Initial program 99.7%
Taylor expanded in y around 0 46.2%
+-commutative46.2%
mul-1-neg46.2%
unsub-neg46.2%
Simplified46.2%
sub-neg46.2%
+-commutative46.2%
distribute-rgt-neg-in46.2%
add-sqr-sqrt22.2%
sqrt-unprod34.5%
sqr-neg34.5%
sqrt-unprod22.4%
add-sqr-sqrt42.0%
Applied egg-rr42.0%
if -1.95000000000000011e-63 < x < 3.00000000000000004e-122Initial program 99.8%
Taylor expanded in y around 0 51.6%
+-commutative51.6%
mul-1-neg51.6%
unsub-neg51.6%
Simplified51.6%
Taylor expanded in x around 0 44.0%
associate-*r*44.0%
neg-mul-144.0%
Simplified44.0%
if 3.00000000000000004e-122 < x Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 60.7%
Final simplification49.2%
(FPCore (x y z) :precision binary64 (- x (* y z)))
double code(double x, double y, double z) {
return x - (y * 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 - (y * z)
end function
public static double code(double x, double y, double z) {
return x - (y * z);
}
def code(x, y, z): return x - (y * z)
function code(x, y, z) return Float64(x - Float64(y * z)) end
function tmp = code(x, y, z) tmp = x - (y * z); end
code[x_, y_, z_] := N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot z
\end{array}
Initial program 99.8%
Taylor expanded in y around 0 55.9%
+-commutative55.9%
mul-1-neg55.9%
unsub-neg55.9%
Simplified55.9%
Final simplification55.9%
(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.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 39.1%
Final simplification39.1%
herbie shell --seed 2023244
(FPCore (x y z)
:name "Diagrams.ThreeD.Transform:aboutX from diagrams-lib-1.3.0.3, A"
:precision binary64
(- (* x (cos y)) (* z (sin y))))