
(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));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
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}
Herbie found 7 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));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
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 (* -1.0 (sin y)) z (* (- (* -1.0 x)) (cos y))))
double code(double x, double y, double z) {
return fma((-1.0 * sin(y)), z, (-(-1.0 * x) * cos(y)));
}
function code(x, y, z) return fma(Float64(-1.0 * sin(y)), z, Float64(Float64(-Float64(-1.0 * x)) * cos(y))) end
code[x_, y_, z_] := N[(N[(-1.0 * N[Sin[y], $MachinePrecision]), $MachinePrecision] * z + N[((-N[(-1.0 * x), $MachinePrecision]) * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-1 \cdot \sin y, z, \left(--1 \cdot x\right) \cdot \cos y\right)
\end{array}
Initial program 99.8%
lift--.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
mul-1-negN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
mul-1-negN/A
lower-*.f64N/A
lift-cos.f6499.8
Applied rewrites99.8%
(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));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
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}
Initial program 99.8%
(FPCore (x y z) :precision binary64 (* (fma (/ (* (sin y) z) x) -1.0 (cos y)) x))
double code(double x, double y, double z) {
return fma(((sin(y) * z) / x), -1.0, cos(y)) * x;
}
function code(x, y, z) return Float64(fma(Float64(Float64(sin(y) * z) / x), -1.0, cos(y)) * x) end
code[x_, y_, z_] := N[(N[(N[(N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision] / x), $MachinePrecision] * -1.0 + N[Cos[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{\sin y \cdot z}{x}, -1, \cos y\right) \cdot x
\end{array}
Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
lift-cos.f6491.5
Applied rewrites91.5%
(FPCore (x y z) :precision binary64 (* (* z (fma -1.0 (/ (sin y) x) (/ (cos y) z))) x))
double code(double x, double y, double z) {
return (z * fma(-1.0, (sin(y) / x), (cos(y) / z))) * x;
}
function code(x, y, z) return Float64(Float64(z * fma(-1.0, Float64(sin(y) / x), Float64(cos(y) / z))) * x) end
code[x_, y_, z_] := N[(N[(z * N[(-1.0 * N[(N[Sin[y], $MachinePrecision] / x), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot \mathsf{fma}\left(-1, \frac{\sin y}{x}, \frac{\cos y}{z}\right)\right) \cdot x
\end{array}
Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
lift-cos.f6491.5
Applied rewrites91.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-cos.f6491.3
Applied rewrites91.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (sin y))))
(/
(fma -1.0 (* x (pow (cos y) 2.0)) (/ (pow t_0 2.0) x))
(- (* -1.0 (/ t_0 x)) (cos y)))))
double code(double x, double y, double z) {
double t_0 = z * sin(y);
return fma(-1.0, (x * pow(cos(y), 2.0)), (pow(t_0, 2.0) / x)) / ((-1.0 * (t_0 / x)) - cos(y));
}
function code(x, y, z) t_0 = Float64(z * sin(y)) return Float64(fma(-1.0, Float64(x * (cos(y) ^ 2.0)), Float64((t_0 ^ 2.0) / x)) / Float64(Float64(-1.0 * Float64(t_0 / x)) - cos(y))) end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, N[(N[(-1.0 * N[(x * N[Power[N[Cos[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[Power[t$95$0, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(N[(-1.0 * N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
\frac{\mathsf{fma}\left(-1, x \cdot {\cos y}^{2}, \frac{{t\_0}^{2}}{x}\right)}{-1 \cdot \frac{t\_0}{x} - \cos y}
\end{array}
\end{array}
Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
lift-cos.f6491.5
Applied rewrites91.5%
lift-cos.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
flip-+N/A
lower-/.f64N/A
Applied rewrites78.9%
Taylor expanded in y around inf
lower-/.f64N/A
Applied rewrites62.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-cos.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6476.9
Applied rewrites76.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (pow (cos y) 2.0))
(t_1 (* z (sin y)))
(t_2
(/
(* x (fma -1.0 (/ (pow t_1 3.0) (pow x 3.0)) (pow (cos y) 3.0)))
(-
(+ (/ (pow t_1 2.0) (* x x)) t_0)
(* -1.0 (/ (* z (* (cos y) (sin y))) x))))))
(if (<= x -3.6e-108)
t_2
(if (<= x 3e-119)
(/
(* (* z z) (fma -1.0 (/ (* x t_0) (* z z)) (/ (pow (sin y) 2.0) x)))
(- (* -1.0 (/ t_1 x)) (cos y)))
t_2))))
double code(double x, double y, double z) {
double t_0 = pow(cos(y), 2.0);
double t_1 = z * sin(y);
double t_2 = (x * fma(-1.0, (pow(t_1, 3.0) / pow(x, 3.0)), pow(cos(y), 3.0))) / (((pow(t_1, 2.0) / (x * x)) + t_0) - (-1.0 * ((z * (cos(y) * sin(y))) / x)));
double tmp;
if (x <= -3.6e-108) {
tmp = t_2;
} else if (x <= 3e-119) {
tmp = ((z * z) * fma(-1.0, ((x * t_0) / (z * z)), (pow(sin(y), 2.0) / x))) / ((-1.0 * (t_1 / x)) - cos(y));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z) t_0 = cos(y) ^ 2.0 t_1 = Float64(z * sin(y)) t_2 = Float64(Float64(x * fma(-1.0, Float64((t_1 ^ 3.0) / (x ^ 3.0)), (cos(y) ^ 3.0))) / Float64(Float64(Float64((t_1 ^ 2.0) / Float64(x * x)) + t_0) - Float64(-1.0 * Float64(Float64(z * Float64(cos(y) * sin(y))) / x)))) tmp = 0.0 if (x <= -3.6e-108) tmp = t_2; elseif (x <= 3e-119) tmp = Float64(Float64(Float64(z * z) * fma(-1.0, Float64(Float64(x * t_0) / Float64(z * z)), Float64((sin(y) ^ 2.0) / x))) / Float64(Float64(-1.0 * Float64(t_1 / x)) - cos(y))); else tmp = t_2; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Power[N[Cos[y], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(-1.0 * N[(N[Power[t$95$1, 3.0], $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[Cos[y], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[t$95$1, 2.0], $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision] - N[(-1.0 * N[(N[(z * N[(N[Cos[y], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e-108], t$95$2, If[LessEqual[x, 3e-119], N[(N[(N[(z * z), $MachinePrecision] * N[(-1.0 * N[(N[(x * t$95$0), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(-1.0 * N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\cos y}^{2}\\
t_1 := z \cdot \sin y\\
t_2 := \frac{x \cdot \mathsf{fma}\left(-1, \frac{{t\_1}^{3}}{{x}^{3}}, {\cos y}^{3}\right)}{\left(\frac{{t\_1}^{2}}{x \cdot x} + t\_0\right) - -1 \cdot \frac{z \cdot \left(\cos y \cdot \sin y\right)}{x}}\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{-108}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-119}:\\
\;\;\;\;\frac{\left(z \cdot z\right) \cdot \mathsf{fma}\left(-1, \frac{x \cdot t\_0}{z \cdot z}, \frac{{\sin y}^{2}}{x}\right)}{-1 \cdot \frac{t\_1}{x} - \cos y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -3.6000000000000001e-108 or 3.0000000000000002e-119 < x Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
lift-cos.f6498.6
Applied rewrites98.6%
lift-cos.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
flip3-+N/A
lower-/.f64N/A
Applied rewrites87.1%
Taylor expanded in y around inf
lower-/.f64N/A
Applied rewrites75.9%
if -3.6000000000000001e-108 < x < 3.0000000000000002e-119Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
lift-cos.f6476.0
Applied rewrites76.0%
lift-cos.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
flip-+N/A
lower-/.f64N/A
Applied rewrites51.8%
Taylor expanded in y around inf
lower-/.f64N/A
Applied rewrites15.1%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-cos.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6435.0
Applied rewrites35.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (sin y))))
(/
(* x (fma -1.0 (/ (pow t_0 3.0) (pow x 3.0)) (pow (cos y) 3.0)))
(-
(+ (/ (pow t_0 2.0) (* x x)) (pow (cos y) 2.0))
(* -1.0 (/ (* z (* (cos y) (sin y))) x))))))
double code(double x, double y, double z) {
double t_0 = z * sin(y);
return (x * fma(-1.0, (pow(t_0, 3.0) / pow(x, 3.0)), pow(cos(y), 3.0))) / (((pow(t_0, 2.0) / (x * x)) + pow(cos(y), 2.0)) - (-1.0 * ((z * (cos(y) * sin(y))) / x)));
}
function code(x, y, z) t_0 = Float64(z * sin(y)) return Float64(Float64(x * fma(-1.0, Float64((t_0 ^ 3.0) / (x ^ 3.0)), (cos(y) ^ 3.0))) / Float64(Float64(Float64((t_0 ^ 2.0) / Float64(x * x)) + (cos(y) ^ 2.0)) - Float64(-1.0 * Float64(Float64(z * Float64(cos(y) * sin(y))) / x)))) end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, N[(N[(x * N[(-1.0 * N[(N[Power[t$95$0, 3.0], $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[Cos[y], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[t$95$0, 2.0], $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[Power[N[Cos[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - N[(-1.0 * N[(N[(z * N[(N[Cos[y], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
\frac{x \cdot \mathsf{fma}\left(-1, \frac{{t\_0}^{3}}{{x}^{3}}, {\cos y}^{3}\right)}{\left(\frac{{t\_0}^{2}}{x \cdot x} + {\cos y}^{2}\right) - -1 \cdot \frac{z \cdot \left(\cos y \cdot \sin y\right)}{x}}
\end{array}
\end{array}
Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
lift-cos.f6491.5
Applied rewrites91.5%
lift-cos.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
flip3-+N/A
lower-/.f64N/A
Applied rewrites73.5%
Taylor expanded in y around inf
lower-/.f64N/A
Applied rewrites52.0%
herbie shell --seed 2025093
(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))))