(FPCore (x y z) :precision binary64 (+ (* x (sin y)) (* z (cos y))))
(FPCore (x y z) :precision binary64 (let* ((t_0 (expm1 (* (log1p (cos y)) 2.0)))) (fma x (sin y) (* z (* (cos y) (/ t_0 t_0))))))
double code(double x, double y, double z) {
return (x * sin(y)) + (z * cos(y));
}
double code(double x, double y, double z) {
double t_0 = expm1((log1p(cos(y)) * 2.0));
return fma(x, sin(y), (z * (cos(y) * (t_0 / t_0))));
}
function code(x, y, z) return Float64(Float64(x * sin(y)) + Float64(z * cos(y))) end
function code(x, y, z) t_0 = expm1(Float64(log1p(cos(y)) * 2.0)) return fma(x, sin(y), Float64(z * Float64(cos(y) * Float64(t_0 / t_0)))) end
code[x_, y_, z_] := N[(N[(x * N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := Block[{t$95$0 = N[(Exp[N[(N[Log[1 + N[Cos[y], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]] - 1), $MachinePrecision]}, N[(x * N[Sin[y], $MachinePrecision] + N[(z * N[(N[Cos[y], $MachinePrecision] * N[(t$95$0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
x \cdot \sin y + z \cdot \cos y
\begin{array}{l}
t_0 := \mathsf{expm1}\left(\mathsf{log1p}\left(\cos y\right) \cdot 2\right)\\
\mathsf{fma}\left(x, \sin y, z \cdot \left(\cos y \cdot \frac{t_0}{t_0}\right)\right)
\end{array}



Bits error versus x



Bits error versus y



Bits error versus z
Initial program 0.1
Simplified0.1
Applied egg-rr0.1
Applied egg-rr0.3
Applied egg-rr0.1
Final simplification0.1
herbie shell --seed 2022133
(FPCore (x y z)
:name "Diagrams.ThreeD.Transform:aboutX from diagrams-lib-1.3.0.3, B"
:precision binary64
(+ (* x (sin y)) (* z (cos y))))