
(FPCore (x y)
:precision binary64
(/
(+
2.0
(*
(*
(* (sqrt 2.0) (- (sin x) (/ (sin y) 16.0)))
(- (sin y) (/ (sin x) 16.0)))
(- (cos x) (cos y))))
(*
3.0
(+
(+ 1.0 (* (/ (- (sqrt 5.0) 1.0) 2.0) (cos x)))
(* (/ (- 3.0 (sqrt 5.0)) 2.0) (cos y))))))
double code(double x, double y) {
return (2.0 + (((sqrt(2.0) * (sin(x) - (sin(y) / 16.0))) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)))) / (3.0 * ((1.0 + (((sqrt(5.0) - 1.0) / 2.0) * cos(x))) + (((3.0 - sqrt(5.0)) / 2.0) * cos(y))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (2.0d0 + (((sqrt(2.0d0) * (sin(x) - (sin(y) / 16.0d0))) * (sin(y) - (sin(x) / 16.0d0))) * (cos(x) - cos(y)))) / (3.0d0 * ((1.0d0 + (((sqrt(5.0d0) - 1.0d0) / 2.0d0) * cos(x))) + (((3.0d0 - sqrt(5.0d0)) / 2.0d0) * cos(y))))
end function
public static double code(double x, double y) {
return (2.0 + (((Math.sqrt(2.0) * (Math.sin(x) - (Math.sin(y) / 16.0))) * (Math.sin(y) - (Math.sin(x) / 16.0))) * (Math.cos(x) - Math.cos(y)))) / (3.0 * ((1.0 + (((Math.sqrt(5.0) - 1.0) / 2.0) * Math.cos(x))) + (((3.0 - Math.sqrt(5.0)) / 2.0) * Math.cos(y))));
}
def code(x, y): return (2.0 + (((math.sqrt(2.0) * (math.sin(x) - (math.sin(y) / 16.0))) * (math.sin(y) - (math.sin(x) / 16.0))) * (math.cos(x) - math.cos(y)))) / (3.0 * ((1.0 + (((math.sqrt(5.0) - 1.0) / 2.0) * math.cos(x))) + (((3.0 - math.sqrt(5.0)) / 2.0) * math.cos(y))))
function code(x, y) return Float64(Float64(2.0 + Float64(Float64(Float64(sqrt(2.0) * Float64(sin(x) - Float64(sin(y) / 16.0))) * Float64(sin(y) - Float64(sin(x) / 16.0))) * Float64(cos(x) - cos(y)))) / Float64(3.0 * Float64(Float64(1.0 + Float64(Float64(Float64(sqrt(5.0) - 1.0) / 2.0) * cos(x))) + Float64(Float64(Float64(3.0 - sqrt(5.0)) / 2.0) * cos(y))))) end
function tmp = code(x, y) tmp = (2.0 + (((sqrt(2.0) * (sin(x) - (sin(y) / 16.0))) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)))) / (3.0 * ((1.0 + (((sqrt(5.0) - 1.0) / 2.0) * cos(x))) + (((3.0 - sqrt(5.0)) / 2.0) * cos(y)))); end
code[x_, y_] := N[(N[(2.0 + N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(N[(1.0 + N[(N[(N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] / 2.0), $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 31 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y)
:precision binary64
(/
(+
2.0
(*
(*
(* (sqrt 2.0) (- (sin x) (/ (sin y) 16.0)))
(- (sin y) (/ (sin x) 16.0)))
(- (cos x) (cos y))))
(*
3.0
(+
(+ 1.0 (* (/ (- (sqrt 5.0) 1.0) 2.0) (cos x)))
(* (/ (- 3.0 (sqrt 5.0)) 2.0) (cos y))))))
double code(double x, double y) {
return (2.0 + (((sqrt(2.0) * (sin(x) - (sin(y) / 16.0))) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)))) / (3.0 * ((1.0 + (((sqrt(5.0) - 1.0) / 2.0) * cos(x))) + (((3.0 - sqrt(5.0)) / 2.0) * cos(y))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (2.0d0 + (((sqrt(2.0d0) * (sin(x) - (sin(y) / 16.0d0))) * (sin(y) - (sin(x) / 16.0d0))) * (cos(x) - cos(y)))) / (3.0d0 * ((1.0d0 + (((sqrt(5.0d0) - 1.0d0) / 2.0d0) * cos(x))) + (((3.0d0 - sqrt(5.0d0)) / 2.0d0) * cos(y))))
end function
public static double code(double x, double y) {
return (2.0 + (((Math.sqrt(2.0) * (Math.sin(x) - (Math.sin(y) / 16.0))) * (Math.sin(y) - (Math.sin(x) / 16.0))) * (Math.cos(x) - Math.cos(y)))) / (3.0 * ((1.0 + (((Math.sqrt(5.0) - 1.0) / 2.0) * Math.cos(x))) + (((3.0 - Math.sqrt(5.0)) / 2.0) * Math.cos(y))));
}
def code(x, y): return (2.0 + (((math.sqrt(2.0) * (math.sin(x) - (math.sin(y) / 16.0))) * (math.sin(y) - (math.sin(x) / 16.0))) * (math.cos(x) - math.cos(y)))) / (3.0 * ((1.0 + (((math.sqrt(5.0) - 1.0) / 2.0) * math.cos(x))) + (((3.0 - math.sqrt(5.0)) / 2.0) * math.cos(y))))
function code(x, y) return Float64(Float64(2.0 + Float64(Float64(Float64(sqrt(2.0) * Float64(sin(x) - Float64(sin(y) / 16.0))) * Float64(sin(y) - Float64(sin(x) / 16.0))) * Float64(cos(x) - cos(y)))) / Float64(3.0 * Float64(Float64(1.0 + Float64(Float64(Float64(sqrt(5.0) - 1.0) / 2.0) * cos(x))) + Float64(Float64(Float64(3.0 - sqrt(5.0)) / 2.0) * cos(y))))) end
function tmp = code(x, y) tmp = (2.0 + (((sqrt(2.0) * (sin(x) - (sin(y) / 16.0))) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)))) / (3.0 * ((1.0 + (((sqrt(5.0) - 1.0) / 2.0) * cos(x))) + (((3.0 - sqrt(5.0)) / 2.0) * cos(y)))); end
code[x_, y_] := N[(N[(2.0 + N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(N[(1.0 + N[(N[(N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] / 2.0), $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}
\end{array}
(FPCore (x y)
:precision binary64
(/
(+
2.0
(*
(*
(* (sqrt 2.0) (- (sin x) (/ (sin y) 16.0)))
(- (sin y) (/ (sin x) 16.0)))
(- (cos x) (cos y))))
(fma
1.5
(fma (cos x) (- (sqrt 5.0) 1.0) (* (/ 4.0 (+ (sqrt 5.0) 3.0)) (cos y)))
3.0)))
double code(double x, double y) {
return (2.0 + (((sqrt(2.0) * (sin(x) - (sin(y) / 16.0))) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)))) / fma(1.5, fma(cos(x), (sqrt(5.0) - 1.0), ((4.0 / (sqrt(5.0) + 3.0)) * cos(y))), 3.0);
}
function code(x, y) return Float64(Float64(2.0 + Float64(Float64(Float64(sqrt(2.0) * Float64(sin(x) - Float64(sin(y) / 16.0))) * Float64(sin(y) - Float64(sin(x) / 16.0))) * Float64(cos(x) - cos(y)))) / fma(1.5, fma(cos(x), Float64(sqrt(5.0) - 1.0), Float64(Float64(4.0 / Float64(sqrt(5.0) + 3.0)) * cos(y))), 3.0)) end
code[x_, y_] := N[(N[(2.0 + N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] + N[(N[(4.0 / N[(N[Sqrt[5.0], $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, \sqrt{5} - 1, \frac{4}{\sqrt{5} + 3} \cdot \cos y\right), 3\right)}
\end{array}
Initial program 99.2%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.3%
Applied rewrites99.3%
(FPCore (x y) :precision binary64 (/ (fma (fma -0.0625 (sin y) (sin x)) (* (* (- (cos x) (cos y)) (sqrt 2.0)) (fma -0.0625 (sin x) (sin y))) 2.0) (fma 1.5 (fma (cos y) (- 3.0 (sqrt 5.0)) (* (cos x) (- (sqrt 5.0) 1.0))) 3.0)))
double code(double x, double y) {
return fma(fma(-0.0625, sin(y), sin(x)), (((cos(x) - cos(y)) * sqrt(2.0)) * fma(-0.0625, sin(x), sin(y))), 2.0) / fma(1.5, fma(cos(y), (3.0 - sqrt(5.0)), (cos(x) * (sqrt(5.0) - 1.0))), 3.0);
}
function code(x, y) return Float64(fma(fma(-0.0625, sin(y), sin(x)), Float64(Float64(Float64(cos(x) - cos(y)) * sqrt(2.0)) * fma(-0.0625, sin(x), sin(y))), 2.0) / fma(1.5, fma(cos(y), Float64(3.0 - sqrt(5.0)), Float64(cos(x) * Float64(sqrt(5.0) - 1.0))), 3.0)) end
code[x_, y_] := N[(N[(N[(-0.0625 * N[Sin[y], $MachinePrecision] + N[Sin[x], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Sin[x], $MachinePrecision] + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(1.5 * N[(N[Cos[y], $MachinePrecision] * N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[x], $MachinePrecision] * N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.0625, \sin y, \sin x\right), \left(\left(\cos x - \cos y\right) \cdot \sqrt{2}\right) \cdot \mathsf{fma}\left(-0.0625, \sin x, \sin y\right), 2\right)}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos y, 3 - \sqrt{5}, \cos x \cdot \left(\sqrt{5} - 1\right)\right), 3\right)}
\end{array}
Initial program 99.2%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.3%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites99.3%
Taylor expanded in x around inf
Applied rewrites99.3%
(FPCore (x y)
:precision binary64
(/
(fma
(sqrt 2.0)
(*
(* (fma -0.0625 (sin y) (sin x)) (fma -0.0625 (sin x) (sin y)))
(- (cos x) (cos y)))
2.0)
(fma
1.5
(fma (cos x) (- (sqrt 5.0) 1.0) (* (- 3.0 (sqrt 5.0)) (cos y)))
3.0)))
double code(double x, double y) {
return fma(sqrt(2.0), ((fma(-0.0625, sin(y), sin(x)) * fma(-0.0625, sin(x), sin(y))) * (cos(x) - cos(y))), 2.0) / fma(1.5, fma(cos(x), (sqrt(5.0) - 1.0), ((3.0 - sqrt(5.0)) * cos(y))), 3.0);
}
function code(x, y) return Float64(fma(sqrt(2.0), Float64(Float64(fma(-0.0625, sin(y), sin(x)) * fma(-0.0625, sin(x), sin(y))) * Float64(cos(x) - cos(y))), 2.0) / fma(1.5, fma(cos(x), Float64(sqrt(5.0) - 1.0), Float64(Float64(3.0 - sqrt(5.0)) * cos(y))), 3.0)) end
code[x_, y_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[(-0.0625 * N[Sin[y], $MachinePrecision] + N[Sin[x], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Sin[x], $MachinePrecision] + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] + N[(N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(\sqrt{2}, \left(\mathsf{fma}\left(-0.0625, \sin y, \sin x\right) \cdot \mathsf{fma}\left(-0.0625, \sin x, \sin y\right)\right) \cdot \left(\cos x - \cos y\right), 2\right)}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, \sqrt{5} - 1, \left(3 - \sqrt{5}\right) \cdot \cos y\right), 3\right)}
\end{array}
Initial program 99.2%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (cos x) (cos y)))
(t_1
(+
2.0
(* (* (* (sin x) (sqrt 2.0)) (- (sin y) (/ (sin x) 16.0))) t_0)))
(t_2 (- (sqrt 5.0) 1.0))
(t_3 (- 3.0 (sqrt 5.0))))
(if (<= x -0.21)
(/ t_1 (fma 1.5 (fma (cos x) t_2 (* t_3 (cos y))) 3.0))
(if (<= x 0.215)
(/
(+
2.0
(*
(*
(* (sqrt 2.0) (- (sin x) (/ (sin y) 16.0)))
(fma (fma 0.010416666666666666 (* x x) -0.0625) x (sin y)))
t_0))
(fma 1.5 (fma (cos x) t_2 (* (/ 4.0 (+ (sqrt 5.0) 3.0)) (cos y))) 3.0))
(/
t_1
(*
3.0
(+ (+ 1.0 (* (/ t_2 2.0) (cos x))) (* (/ t_3 2.0) (cos y)))))))))
double code(double x, double y) {
double t_0 = cos(x) - cos(y);
double t_1 = 2.0 + (((sin(x) * sqrt(2.0)) * (sin(y) - (sin(x) / 16.0))) * t_0);
double t_2 = sqrt(5.0) - 1.0;
double t_3 = 3.0 - sqrt(5.0);
double tmp;
if (x <= -0.21) {
tmp = t_1 / fma(1.5, fma(cos(x), t_2, (t_3 * cos(y))), 3.0);
} else if (x <= 0.215) {
tmp = (2.0 + (((sqrt(2.0) * (sin(x) - (sin(y) / 16.0))) * fma(fma(0.010416666666666666, (x * x), -0.0625), x, sin(y))) * t_0)) / fma(1.5, fma(cos(x), t_2, ((4.0 / (sqrt(5.0) + 3.0)) * cos(y))), 3.0);
} else {
tmp = t_1 / (3.0 * ((1.0 + ((t_2 / 2.0) * cos(x))) + ((t_3 / 2.0) * cos(y))));
}
return tmp;
}
function code(x, y) t_0 = Float64(cos(x) - cos(y)) t_1 = Float64(2.0 + Float64(Float64(Float64(sin(x) * sqrt(2.0)) * Float64(sin(y) - Float64(sin(x) / 16.0))) * t_0)) t_2 = Float64(sqrt(5.0) - 1.0) t_3 = Float64(3.0 - sqrt(5.0)) tmp = 0.0 if (x <= -0.21) tmp = Float64(t_1 / fma(1.5, fma(cos(x), t_2, Float64(t_3 * cos(y))), 3.0)); elseif (x <= 0.215) tmp = Float64(Float64(2.0 + Float64(Float64(Float64(sqrt(2.0) * Float64(sin(x) - Float64(sin(y) / 16.0))) * fma(fma(0.010416666666666666, Float64(x * x), -0.0625), x, sin(y))) * t_0)) / fma(1.5, fma(cos(x), t_2, Float64(Float64(4.0 / Float64(sqrt(5.0) + 3.0)) * cos(y))), 3.0)); else tmp = Float64(t_1 / Float64(3.0 * Float64(Float64(1.0 + Float64(Float64(t_2 / 2.0) * cos(x))) + Float64(Float64(t_3 / 2.0) * cos(y))))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 + N[(N[(N[(N[Sin[x], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.21], N[(t$95$1 / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * t$95$2 + N[(t$95$3 * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.215], N[(N[(2.0 + N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.010416666666666666 * N[(x * x), $MachinePrecision] + -0.0625), $MachinePrecision] * x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * t$95$2 + N[(N[(4.0 / N[(N[Sqrt[5.0], $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(3.0 * N[(N[(1.0 + N[(N[(t$95$2 / 2.0), $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 / 2.0), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos x - \cos y\\
t_1 := 2 + \left(\left(\sin x \cdot \sqrt{2}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot t\_0\\
t_2 := \sqrt{5} - 1\\
t_3 := 3 - \sqrt{5}\\
\mathbf{if}\;x \leq -0.21:\\
\;\;\;\;\frac{t\_1}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, t\_2, t\_3 \cdot \cos y\right), 3\right)}\\
\mathbf{elif}\;x \leq 0.215:\\
\;\;\;\;\frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.010416666666666666, x \cdot x, -0.0625\right), x, \sin y\right)\right) \cdot t\_0}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, t\_2, \frac{4}{\sqrt{5} + 3} \cdot \cos y\right), 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{3 \cdot \left(\left(1 + \frac{t\_2}{2} \cdot \cos x\right) + \frac{t\_3}{2} \cdot \cos y\right)}\\
\end{array}
\end{array}
if x < -0.209999999999999992Initial program 98.5%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f6454.1
Applied rewrites54.1%
if -0.209999999999999992 < x < 0.214999999999999997Initial program 99.6%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.6%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
if 0.214999999999999997 < x Initial program 99.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f6468.0
Applied rewrites68.0%
(FPCore (x y)
:precision binary64
(let* ((t_0
(+
2.0
(*
(* (* (sin x) (sqrt 2.0)) (- (sin y) (/ (sin x) 16.0)))
(- (cos x) (cos y)))))
(t_1 (- (sqrt 5.0) 1.0))
(t_2 (- 3.0 (sqrt 5.0)))
(t_3 (fma 1.5 (fma (cos x) t_1 (* t_2 (cos y))) 3.0)))
(if (<= x -0.25)
(/ t_0 t_3)
(if (<= x 0.34)
(/
(fma
(fma -0.0625 (sin y) (sin x))
(*
(*
(fma
(fma 0.041666666666666664 (* x x) -0.5)
(* x x)
(- 1.0 (cos y)))
(sqrt 2.0))
(fma -0.0625 (sin x) (sin y)))
2.0)
t_3)
(/
t_0
(*
3.0
(+ (+ 1.0 (* (/ t_1 2.0) (cos x))) (* (/ t_2 2.0) (cos y)))))))))
double code(double x, double y) {
double t_0 = 2.0 + (((sin(x) * sqrt(2.0)) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)));
double t_1 = sqrt(5.0) - 1.0;
double t_2 = 3.0 - sqrt(5.0);
double t_3 = fma(1.5, fma(cos(x), t_1, (t_2 * cos(y))), 3.0);
double tmp;
if (x <= -0.25) {
tmp = t_0 / t_3;
} else if (x <= 0.34) {
tmp = fma(fma(-0.0625, sin(y), sin(x)), ((fma(fma(0.041666666666666664, (x * x), -0.5), (x * x), (1.0 - cos(y))) * sqrt(2.0)) * fma(-0.0625, sin(x), sin(y))), 2.0) / t_3;
} else {
tmp = t_0 / (3.0 * ((1.0 + ((t_1 / 2.0) * cos(x))) + ((t_2 / 2.0) * cos(y))));
}
return tmp;
}
function code(x, y) t_0 = Float64(2.0 + Float64(Float64(Float64(sin(x) * sqrt(2.0)) * Float64(sin(y) - Float64(sin(x) / 16.0))) * Float64(cos(x) - cos(y)))) t_1 = Float64(sqrt(5.0) - 1.0) t_2 = Float64(3.0 - sqrt(5.0)) t_3 = fma(1.5, fma(cos(x), t_1, Float64(t_2 * cos(y))), 3.0) tmp = 0.0 if (x <= -0.25) tmp = Float64(t_0 / t_3); elseif (x <= 0.34) tmp = Float64(fma(fma(-0.0625, sin(y), sin(x)), Float64(Float64(fma(fma(0.041666666666666664, Float64(x * x), -0.5), Float64(x * x), Float64(1.0 - cos(y))) * sqrt(2.0)) * fma(-0.0625, sin(x), sin(y))), 2.0) / t_3); else tmp = Float64(t_0 / Float64(3.0 * Float64(Float64(1.0 + Float64(Float64(t_1 / 2.0) * cos(x))) + Float64(Float64(t_2 / 2.0) * cos(y))))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(2.0 + N[(N[(N[(N[Sin[x], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.5 * N[(N[Cos[x], $MachinePrecision] * t$95$1 + N[(t$95$2 * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]}, If[LessEqual[x, -0.25], N[(t$95$0 / t$95$3), $MachinePrecision], If[LessEqual[x, 0.34], N[(N[(N[(-0.0625 * N[Sin[y], $MachinePrecision] + N[Sin[x], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(0.041666666666666664 * N[(x * x), $MachinePrecision] + -0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Sin[x], $MachinePrecision] + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / t$95$3), $MachinePrecision], N[(t$95$0 / N[(3.0 * N[(N[(1.0 + N[(N[(t$95$1 / 2.0), $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 / 2.0), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + \left(\left(\sin x \cdot \sqrt{2}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)\\
t_1 := \sqrt{5} - 1\\
t_2 := 3 - \sqrt{5}\\
t_3 := \mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, t\_1, t\_2 \cdot \cos y\right), 3\right)\\
\mathbf{if}\;x \leq -0.25:\\
\;\;\;\;\frac{t\_0}{t\_3}\\
\mathbf{elif}\;x \leq 0.34:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.0625, \sin y, \sin x\right), \left(\mathsf{fma}\left(\mathsf{fma}\left(0.041666666666666664, x \cdot x, -0.5\right), x \cdot x, 1 - \cos y\right) \cdot \sqrt{2}\right) \cdot \mathsf{fma}\left(-0.0625, \sin x, \sin y\right), 2\right)}{t\_3}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{3 \cdot \left(\left(1 + \frac{t\_1}{2} \cdot \cos x\right) + \frac{t\_2}{2} \cdot \cos y\right)}\\
\end{array}
\end{array}
if x < -0.25Initial program 98.5%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f6454.1
Applied rewrites54.1%
if -0.25 < x < 0.340000000000000024Initial program 99.6%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.6%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f6499.6
Applied rewrites99.6%
if 0.340000000000000024 < x Initial program 99.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f6468.0
Applied rewrites68.0%
(FPCore (x y)
:precision binary64
(let* ((t_0
(fma
1.5
(fma (cos x) (- (sqrt 5.0) 1.0) (* (- 3.0 (sqrt 5.0)) (cos y)))
3.0)))
(if (or (<= x -0.25) (not (<= x 0.34)))
(/
(+
2.0
(*
(* (* (sin x) (sqrt 2.0)) (- (sin y) (/ (sin x) 16.0)))
(- (cos x) (cos y))))
t_0)
(/
(fma
(fma -0.0625 (sin y) (sin x))
(*
(*
(fma (fma 0.041666666666666664 (* x x) -0.5) (* x x) (- 1.0 (cos y)))
(sqrt 2.0))
(fma -0.0625 (sin x) (sin y)))
2.0)
t_0))))
double code(double x, double y) {
double t_0 = fma(1.5, fma(cos(x), (sqrt(5.0) - 1.0), ((3.0 - sqrt(5.0)) * cos(y))), 3.0);
double tmp;
if ((x <= -0.25) || !(x <= 0.34)) {
tmp = (2.0 + (((sin(x) * sqrt(2.0)) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)))) / t_0;
} else {
tmp = fma(fma(-0.0625, sin(y), sin(x)), ((fma(fma(0.041666666666666664, (x * x), -0.5), (x * x), (1.0 - cos(y))) * sqrt(2.0)) * fma(-0.0625, sin(x), sin(y))), 2.0) / t_0;
}
return tmp;
}
function code(x, y) t_0 = fma(1.5, fma(cos(x), Float64(sqrt(5.0) - 1.0), Float64(Float64(3.0 - sqrt(5.0)) * cos(y))), 3.0) tmp = 0.0 if ((x <= -0.25) || !(x <= 0.34)) tmp = Float64(Float64(2.0 + Float64(Float64(Float64(sin(x) * sqrt(2.0)) * Float64(sin(y) - Float64(sin(x) / 16.0))) * Float64(cos(x) - cos(y)))) / t_0); else tmp = Float64(fma(fma(-0.0625, sin(y), sin(x)), Float64(Float64(fma(fma(0.041666666666666664, Float64(x * x), -0.5), Float64(x * x), Float64(1.0 - cos(y))) * sqrt(2.0)) * fma(-0.0625, sin(x), sin(y))), 2.0) / t_0); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(1.5 * N[(N[Cos[x], $MachinePrecision] * N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] + N[(N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]}, If[Or[LessEqual[x, -0.25], N[Not[LessEqual[x, 0.34]], $MachinePrecision]], N[(N[(2.0 + N[(N[(N[(N[Sin[x], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[(-0.0625 * N[Sin[y], $MachinePrecision] + N[Sin[x], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(0.041666666666666664 * N[(x * x), $MachinePrecision] + -0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Sin[x], $MachinePrecision] + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, \sqrt{5} - 1, \left(3 - \sqrt{5}\right) \cdot \cos y\right), 3\right)\\
\mathbf{if}\;x \leq -0.25 \lor \neg \left(x \leq 0.34\right):\\
\;\;\;\;\frac{2 + \left(\left(\sin x \cdot \sqrt{2}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.0625, \sin y, \sin x\right), \left(\mathsf{fma}\left(\mathsf{fma}\left(0.041666666666666664, x \cdot x, -0.5\right), x \cdot x, 1 - \cos y\right) \cdot \sqrt{2}\right) \cdot \mathsf{fma}\left(-0.0625, \sin x, \sin y\right), 2\right)}{t\_0}\\
\end{array}
\end{array}
if x < -0.25 or 0.340000000000000024 < x Initial program 98.8%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f6462.3
Applied rewrites62.3%
if -0.25 < x < 0.340000000000000024Initial program 99.6%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.6%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f6499.6
Applied rewrites99.6%
Final simplification81.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (cos x) (cos y)))
(t_1 (- (sqrt 5.0) 1.0))
(t_2 (- (sin y) (/ (sin x) 16.0)))
(t_3 (- 3.0 (sqrt 5.0))))
(if (or (<= x -0.065) (not (<= x 0.105)))
(/
(+ 2.0 (* (* (* (sin x) (sqrt 2.0)) t_2) t_0))
(fma 1.5 (fma (cos x) t_1 (* t_3 (cos y))) 3.0))
(/
(+
2.0
(*
(*
(fma
(* (fma -0.16666666666666666 (* x x) 1.0) (sqrt 2.0))
x
(* (* -0.0625 (sin y)) (sqrt 2.0)))
t_2)
t_0))
(*
3.0
(fma
0.5
(fma (cos y) t_3 t_1)
(fma
(* t_1 (fma 0.020833333333333332 (* x x) -0.25))
(* x x)
1.0)))))))
double code(double x, double y) {
double t_0 = cos(x) - cos(y);
double t_1 = sqrt(5.0) - 1.0;
double t_2 = sin(y) - (sin(x) / 16.0);
double t_3 = 3.0 - sqrt(5.0);
double tmp;
if ((x <= -0.065) || !(x <= 0.105)) {
tmp = (2.0 + (((sin(x) * sqrt(2.0)) * t_2) * t_0)) / fma(1.5, fma(cos(x), t_1, (t_3 * cos(y))), 3.0);
} else {
tmp = (2.0 + ((fma((fma(-0.16666666666666666, (x * x), 1.0) * sqrt(2.0)), x, ((-0.0625 * sin(y)) * sqrt(2.0))) * t_2) * t_0)) / (3.0 * fma(0.5, fma(cos(y), t_3, t_1), fma((t_1 * fma(0.020833333333333332, (x * x), -0.25)), (x * x), 1.0)));
}
return tmp;
}
function code(x, y) t_0 = Float64(cos(x) - cos(y)) t_1 = Float64(sqrt(5.0) - 1.0) t_2 = Float64(sin(y) - Float64(sin(x) / 16.0)) t_3 = Float64(3.0 - sqrt(5.0)) tmp = 0.0 if ((x <= -0.065) || !(x <= 0.105)) tmp = Float64(Float64(2.0 + Float64(Float64(Float64(sin(x) * sqrt(2.0)) * t_2) * t_0)) / fma(1.5, fma(cos(x), t_1, Float64(t_3 * cos(y))), 3.0)); else tmp = Float64(Float64(2.0 + Float64(Float64(fma(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * sqrt(2.0)), x, Float64(Float64(-0.0625 * sin(y)) * sqrt(2.0))) * t_2) * t_0)) / Float64(3.0 * fma(0.5, fma(cos(y), t_3, t_1), fma(Float64(t_1 * fma(0.020833333333333332, Float64(x * x), -0.25)), Float64(x * x), 1.0)))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -0.065], N[Not[LessEqual[x, 0.105]], $MachinePrecision]], N[(N[(2.0 + N[(N[(N[(N[Sin[x], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * t$95$1 + N[(t$95$3 * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(N[(N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * x + N[(N[(-0.0625 * N[Sin[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(0.5 * N[(N[Cos[y], $MachinePrecision] * t$95$3 + t$95$1), $MachinePrecision] + N[(N[(t$95$1 * N[(0.020833333333333332 * N[(x * x), $MachinePrecision] + -0.25), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos x - \cos y\\
t_1 := \sqrt{5} - 1\\
t_2 := \sin y - \frac{\sin x}{16}\\
t_3 := 3 - \sqrt{5}\\
\mathbf{if}\;x \leq -0.065 \lor \neg \left(x \leq 0.105\right):\\
\;\;\;\;\frac{2 + \left(\left(\sin x \cdot \sqrt{2}\right) \cdot t\_2\right) \cdot t\_0}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, t\_1, t\_3 \cdot \cos y\right), 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \sqrt{2}, x, \left(-0.0625 \cdot \sin y\right) \cdot \sqrt{2}\right) \cdot t\_2\right) \cdot t\_0}{3 \cdot \mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos y, t\_3, t\_1\right), \mathsf{fma}\left(t\_1 \cdot \mathsf{fma}\left(0.020833333333333332, x \cdot x, -0.25\right), x \cdot x, 1\right)\right)}\\
\end{array}
\end{array}
if x < -0.065000000000000002 or 0.104999999999999996 < x Initial program 98.8%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f6462.3
Applied rewrites62.3%
if -0.065000000000000002 < x < 0.104999999999999996Initial program 99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
distribute-lft-outN/A
lower-fma.f64N/A
Applied rewrites99.5%
Final simplification81.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 3.0 (sqrt 5.0))) (t_1 (- (sqrt 5.0) 1.0)))
(if (or (<= x -0.065) (not (<= x 0.105)))
(/
(fma
(fma -0.0625 (sin y) (sin x))
(* (* (- (cos x) 1.0) (sqrt 2.0)) (fma -0.0625 (sin x) (sin y)))
2.0)
(fma 1.5 (fma (cos x) t_1 (* t_0 (cos y))) 3.0))
(/
(+
2.0
(*
(*
(fma
(* (fma -0.16666666666666666 (* x x) 1.0) (sqrt 2.0))
x
(* (* -0.0625 (sin y)) (sqrt 2.0)))
(- (sin y) (/ (sin x) 16.0)))
(- (cos x) (cos y))))
(*
3.0
(fma
0.5
(fma (cos y) t_0 t_1)
(fma
(* t_1 (fma 0.020833333333333332 (* x x) -0.25))
(* x x)
1.0)))))))
double code(double x, double y) {
double t_0 = 3.0 - sqrt(5.0);
double t_1 = sqrt(5.0) - 1.0;
double tmp;
if ((x <= -0.065) || !(x <= 0.105)) {
tmp = fma(fma(-0.0625, sin(y), sin(x)), (((cos(x) - 1.0) * sqrt(2.0)) * fma(-0.0625, sin(x), sin(y))), 2.0) / fma(1.5, fma(cos(x), t_1, (t_0 * cos(y))), 3.0);
} else {
tmp = (2.0 + ((fma((fma(-0.16666666666666666, (x * x), 1.0) * sqrt(2.0)), x, ((-0.0625 * sin(y)) * sqrt(2.0))) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)))) / (3.0 * fma(0.5, fma(cos(y), t_0, t_1), fma((t_1 * fma(0.020833333333333332, (x * x), -0.25)), (x * x), 1.0)));
}
return tmp;
}
function code(x, y) t_0 = Float64(3.0 - sqrt(5.0)) t_1 = Float64(sqrt(5.0) - 1.0) tmp = 0.0 if ((x <= -0.065) || !(x <= 0.105)) tmp = Float64(fma(fma(-0.0625, sin(y), sin(x)), Float64(Float64(Float64(cos(x) - 1.0) * sqrt(2.0)) * fma(-0.0625, sin(x), sin(y))), 2.0) / fma(1.5, fma(cos(x), t_1, Float64(t_0 * cos(y))), 3.0)); else tmp = Float64(Float64(2.0 + Float64(Float64(fma(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * sqrt(2.0)), x, Float64(Float64(-0.0625 * sin(y)) * sqrt(2.0))) * Float64(sin(y) - Float64(sin(x) / 16.0))) * Float64(cos(x) - cos(y)))) / Float64(3.0 * fma(0.5, fma(cos(y), t_0, t_1), fma(Float64(t_1 * fma(0.020833333333333332, Float64(x * x), -0.25)), Float64(x * x), 1.0)))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, If[Or[LessEqual[x, -0.065], N[Not[LessEqual[x, 0.105]], $MachinePrecision]], N[(N[(N[(-0.0625 * N[Sin[y], $MachinePrecision] + N[Sin[x], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Cos[x], $MachinePrecision] - 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Sin[x], $MachinePrecision] + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * t$95$1 + N[(t$95$0 * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(N[(N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * x + N[(N[(-0.0625 * N[Sin[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(0.5 * N[(N[Cos[y], $MachinePrecision] * t$95$0 + t$95$1), $MachinePrecision] + N[(N[(t$95$1 * N[(0.020833333333333332 * N[(x * x), $MachinePrecision] + -0.25), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - \sqrt{5}\\
t_1 := \sqrt{5} - 1\\
\mathbf{if}\;x \leq -0.065 \lor \neg \left(x \leq 0.105\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.0625, \sin y, \sin x\right), \left(\left(\cos x - 1\right) \cdot \sqrt{2}\right) \cdot \mathsf{fma}\left(-0.0625, \sin x, \sin y\right), 2\right)}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, t\_1, t\_0 \cdot \cos y\right), 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \sqrt{2}, x, \left(-0.0625 \cdot \sin y\right) \cdot \sqrt{2}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos y, t\_0, t\_1\right), \mathsf{fma}\left(t\_1 \cdot \mathsf{fma}\left(0.020833333333333332, x \cdot x, -0.25\right), x \cdot x, 1\right)\right)}\\
\end{array}
\end{array}
if x < -0.065000000000000002 or 0.104999999999999996 < x Initial program 98.8%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.0%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites99.0%
Taylor expanded in y around 0
lower--.f64N/A
lower-cos.f6459.8
Applied rewrites59.8%
if -0.065000000000000002 < x < 0.104999999999999996Initial program 99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
distribute-lft-outN/A
lower-fma.f64N/A
Applied rewrites99.5%
Final simplification79.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 3.0 (sqrt 5.0))) (t_1 (- (sqrt 5.0) 1.0)))
(if (<= x -0.065)
(/
(/
(fma (fma -0.0625 (cos x) 0.0625) (* (pow (sin x) 2.0) (sqrt 2.0)) 2.0)
(fma (* 0.5 t_0) (cos y) (fma (fma (sqrt 5.0) 0.5 -0.5) (cos x) 1.0)))
3.0)
(if (<= x 0.105)
(/
(+
2.0
(*
(*
(fma
(* (fma -0.16666666666666666 (* x x) 1.0) (sqrt 2.0))
x
(* (* -0.0625 (sin y)) (sqrt 2.0)))
(- (sin y) (/ (sin x) 16.0)))
(- (cos x) (cos y))))
(*
3.0
(fma
0.5
(fma (cos y) t_0 t_1)
(fma (* t_1 (fma 0.020833333333333332 (* x x) -0.25)) (* x x) 1.0))))
(/
(+
2.0
(*
(fma (sin x) -0.0625 (sin y))
(* (* (sin x) (sqrt 2.0)) (- (cos x) 1.0))))
(*
3.0
(+ (+ 1.0 (* (/ t_1 2.0) (cos x))) (* (/ t_0 2.0) (cos y)))))))))
double code(double x, double y) {
double t_0 = 3.0 - sqrt(5.0);
double t_1 = sqrt(5.0) - 1.0;
double tmp;
if (x <= -0.065) {
tmp = (fma(fma(-0.0625, cos(x), 0.0625), (pow(sin(x), 2.0) * sqrt(2.0)), 2.0) / fma((0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0))) / 3.0;
} else if (x <= 0.105) {
tmp = (2.0 + ((fma((fma(-0.16666666666666666, (x * x), 1.0) * sqrt(2.0)), x, ((-0.0625 * sin(y)) * sqrt(2.0))) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)))) / (3.0 * fma(0.5, fma(cos(y), t_0, t_1), fma((t_1 * fma(0.020833333333333332, (x * x), -0.25)), (x * x), 1.0)));
} else {
tmp = (2.0 + (fma(sin(x), -0.0625, sin(y)) * ((sin(x) * sqrt(2.0)) * (cos(x) - 1.0)))) / (3.0 * ((1.0 + ((t_1 / 2.0) * cos(x))) + ((t_0 / 2.0) * cos(y))));
}
return tmp;
}
function code(x, y) t_0 = Float64(3.0 - sqrt(5.0)) t_1 = Float64(sqrt(5.0) - 1.0) tmp = 0.0 if (x <= -0.065) tmp = Float64(Float64(fma(fma(-0.0625, cos(x), 0.0625), Float64((sin(x) ^ 2.0) * sqrt(2.0)), 2.0) / fma(Float64(0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0))) / 3.0); elseif (x <= 0.105) tmp = Float64(Float64(2.0 + Float64(Float64(fma(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * sqrt(2.0)), x, Float64(Float64(-0.0625 * sin(y)) * sqrt(2.0))) * Float64(sin(y) - Float64(sin(x) / 16.0))) * Float64(cos(x) - cos(y)))) / Float64(3.0 * fma(0.5, fma(cos(y), t_0, t_1), fma(Float64(t_1 * fma(0.020833333333333332, Float64(x * x), -0.25)), Float64(x * x), 1.0)))); else tmp = Float64(Float64(2.0 + Float64(fma(sin(x), -0.0625, sin(y)) * Float64(Float64(sin(x) * sqrt(2.0)) * Float64(cos(x) - 1.0)))) / Float64(3.0 * Float64(Float64(1.0 + Float64(Float64(t_1 / 2.0) * cos(x))) + Float64(Float64(t_0 / 2.0) * cos(y))))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, If[LessEqual[x, -0.065], N[(N[(N[(N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] * N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(N[(0.5 * t$95$0), $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[(N[Sqrt[5.0], $MachinePrecision] * 0.5 + -0.5), $MachinePrecision] * N[Cos[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision], If[LessEqual[x, 0.105], N[(N[(2.0 + N[(N[(N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * x + N[(N[(-0.0625 * N[Sin[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(0.5 * N[(N[Cos[y], $MachinePrecision] * t$95$0 + t$95$1), $MachinePrecision] + N[(N[(t$95$1 * N[(0.020833333333333332 * N[(x * x), $MachinePrecision] + -0.25), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(N[(N[Sin[x], $MachinePrecision] * -0.0625 + N[Sin[y], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[x], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(N[(1.0 + N[(N[(t$95$1 / 2.0), $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 / 2.0), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - \sqrt{5}\\
t_1 := \sqrt{5} - 1\\
\mathbf{if}\;x \leq -0.065:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), {\sin x}^{2} \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(0.5 \cdot t\_0, \cos y, \mathsf{fma}\left(\mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right), \cos x, 1\right)\right)}}{3}\\
\mathbf{elif}\;x \leq 0.105:\\
\;\;\;\;\frac{2 + \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \sqrt{2}, x, \left(-0.0625 \cdot \sin y\right) \cdot \sqrt{2}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos y, t\_0, t\_1\right), \mathsf{fma}\left(t\_1 \cdot \mathsf{fma}\left(0.020833333333333332, x \cdot x, -0.25\right), x \cdot x, 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \mathsf{fma}\left(\sin x, -0.0625, \sin y\right) \cdot \left(\left(\sin x \cdot \sqrt{2}\right) \cdot \left(\cos x - 1\right)\right)}{3 \cdot \left(\left(1 + \frac{t\_1}{2} \cdot \cos x\right) + \frac{t\_0}{2} \cdot \cos y\right)}\\
\end{array}
\end{array}
if x < -0.065000000000000002Initial program 98.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6450.5
Applied rewrites50.5%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6450.6
Applied rewrites50.6%
Applied rewrites50.7%
if -0.065000000000000002 < x < 0.104999999999999996Initial program 99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
distribute-lft-outN/A
lower-fma.f64N/A
Applied rewrites99.5%
if 0.104999999999999996 < x Initial program 99.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites99.0%
Taylor expanded in y around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower--.f64N/A
lower-cos.f6465.5
Applied rewrites65.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 3.0 (sqrt 5.0))) (t_1 (- (sqrt 5.0) 1.0)))
(if (<= x -0.0265)
(/
(/
(fma (fma -0.0625 (cos x) 0.0625) (* (pow (sin x) 2.0) (sqrt 2.0)) 2.0)
(fma (* 0.5 t_0) (cos y) (fma (fma (sqrt 5.0) 0.5 -0.5) (cos x) 1.0)))
3.0)
(if (<= x 0.017)
(/
(+
2.0
(*
(*
(fma
(* (fma -0.16666666666666666 (* x x) 1.0) (sqrt 2.0))
x
(* (* -0.0625 (sin y)) (sqrt 2.0)))
(- (sin y) (/ (sin x) 16.0)))
(fma
(fma 0.041666666666666664 (* x x) -0.5)
(* x x)
(- 1.0 (cos y)))))
(*
3.0
(fma (* (cos y) 0.5) t_0 (fma t_1 (fma -0.25 (* x x) 0.5) 1.0))))
(/
(+
2.0
(*
(fma (sin x) -0.0625 (sin y))
(* (* (sin x) (sqrt 2.0)) (- (cos x) 1.0))))
(*
3.0
(+ (+ 1.0 (* (/ t_1 2.0) (cos x))) (* (/ t_0 2.0) (cos y)))))))))
double code(double x, double y) {
double t_0 = 3.0 - sqrt(5.0);
double t_1 = sqrt(5.0) - 1.0;
double tmp;
if (x <= -0.0265) {
tmp = (fma(fma(-0.0625, cos(x), 0.0625), (pow(sin(x), 2.0) * sqrt(2.0)), 2.0) / fma((0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0))) / 3.0;
} else if (x <= 0.017) {
tmp = (2.0 + ((fma((fma(-0.16666666666666666, (x * x), 1.0) * sqrt(2.0)), x, ((-0.0625 * sin(y)) * sqrt(2.0))) * (sin(y) - (sin(x) / 16.0))) * fma(fma(0.041666666666666664, (x * x), -0.5), (x * x), (1.0 - cos(y))))) / (3.0 * fma((cos(y) * 0.5), t_0, fma(t_1, fma(-0.25, (x * x), 0.5), 1.0)));
} else {
tmp = (2.0 + (fma(sin(x), -0.0625, sin(y)) * ((sin(x) * sqrt(2.0)) * (cos(x) - 1.0)))) / (3.0 * ((1.0 + ((t_1 / 2.0) * cos(x))) + ((t_0 / 2.0) * cos(y))));
}
return tmp;
}
function code(x, y) t_0 = Float64(3.0 - sqrt(5.0)) t_1 = Float64(sqrt(5.0) - 1.0) tmp = 0.0 if (x <= -0.0265) tmp = Float64(Float64(fma(fma(-0.0625, cos(x), 0.0625), Float64((sin(x) ^ 2.0) * sqrt(2.0)), 2.0) / fma(Float64(0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0))) / 3.0); elseif (x <= 0.017) tmp = Float64(Float64(2.0 + Float64(Float64(fma(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * sqrt(2.0)), x, Float64(Float64(-0.0625 * sin(y)) * sqrt(2.0))) * Float64(sin(y) - Float64(sin(x) / 16.0))) * fma(fma(0.041666666666666664, Float64(x * x), -0.5), Float64(x * x), Float64(1.0 - cos(y))))) / Float64(3.0 * fma(Float64(cos(y) * 0.5), t_0, fma(t_1, fma(-0.25, Float64(x * x), 0.5), 1.0)))); else tmp = Float64(Float64(2.0 + Float64(fma(sin(x), -0.0625, sin(y)) * Float64(Float64(sin(x) * sqrt(2.0)) * Float64(cos(x) - 1.0)))) / Float64(3.0 * Float64(Float64(1.0 + Float64(Float64(t_1 / 2.0) * cos(x))) + Float64(Float64(t_0 / 2.0) * cos(y))))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, If[LessEqual[x, -0.0265], N[(N[(N[(N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] * N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(N[(0.5 * t$95$0), $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[(N[Sqrt[5.0], $MachinePrecision] * 0.5 + -0.5), $MachinePrecision] * N[Cos[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision], If[LessEqual[x, 0.017], N[(N[(2.0 + N[(N[(N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * x + N[(N[(-0.0625 * N[Sin[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.041666666666666664 * N[(x * x), $MachinePrecision] + -0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(N[(N[Cos[y], $MachinePrecision] * 0.5), $MachinePrecision] * t$95$0 + N[(t$95$1 * N[(-0.25 * N[(x * x), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(N[(N[Sin[x], $MachinePrecision] * -0.0625 + N[Sin[y], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[x], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(N[(1.0 + N[(N[(t$95$1 / 2.0), $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 / 2.0), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - \sqrt{5}\\
t_1 := \sqrt{5} - 1\\
\mathbf{if}\;x \leq -0.0265:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), {\sin x}^{2} \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(0.5 \cdot t\_0, \cos y, \mathsf{fma}\left(\mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right), \cos x, 1\right)\right)}}{3}\\
\mathbf{elif}\;x \leq 0.017:\\
\;\;\;\;\frac{2 + \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \sqrt{2}, x, \left(-0.0625 \cdot \sin y\right) \cdot \sqrt{2}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.041666666666666664, x \cdot x, -0.5\right), x \cdot x, 1 - \cos y\right)}{3 \cdot \mathsf{fma}\left(\cos y \cdot 0.5, t\_0, \mathsf{fma}\left(t\_1, \mathsf{fma}\left(-0.25, x \cdot x, 0.5\right), 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \mathsf{fma}\left(\sin x, -0.0625, \sin y\right) \cdot \left(\left(\sin x \cdot \sqrt{2}\right) \cdot \left(\cos x - 1\right)\right)}{3 \cdot \left(\left(1 + \frac{t\_1}{2} \cdot \cos x\right) + \frac{t\_0}{2} \cdot \cos y\right)}\\
\end{array}
\end{array}
if x < -0.0264999999999999993Initial program 98.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6450.5
Applied rewrites50.5%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6450.6
Applied rewrites50.6%
Applied rewrites50.7%
if -0.0264999999999999993 < x < 0.017000000000000001Initial program 99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f6499.3
Applied rewrites99.3%
if 0.017000000000000001 < x Initial program 99.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites99.0%
Taylor expanded in y around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower--.f64N/A
lower-cos.f6465.5
Applied rewrites65.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 3.0 (sqrt 5.0)))
(t_1 (- (sqrt 5.0) 1.0))
(t_2 (pow (sin x) 2.0)))
(if (<= x -0.00071)
(pow
(/
(fma (fma t_1 (cos x) (* t_0 (cos y))) 1.5 3.0)
(fma (fma (cos x) -0.0625 0.0625) (* (sqrt 2.0) t_2) 2.0))
-1.0)
(if (<= x 0.0014)
(/
(fma (* -0.0625 (pow (sin y) 2.0)) (* (- 1.0 (cos y)) (sqrt 2.0)) 2.0)
(fma 1.5 (fma (cos x) t_1 (* (/ 4.0 (+ (sqrt 5.0) 3.0)) (cos y))) 3.0))
(*
(/
0.3333333333333333
(fma (* 0.5 t_0) (cos y) (fma (fma (sqrt 5.0) 0.5 -0.5) (cos x) 1.0)))
(fma (fma -0.0625 (cos x) 0.0625) (* t_2 (sqrt 2.0)) 2.0))))))
double code(double x, double y) {
double t_0 = 3.0 - sqrt(5.0);
double t_1 = sqrt(5.0) - 1.0;
double t_2 = pow(sin(x), 2.0);
double tmp;
if (x <= -0.00071) {
tmp = pow((fma(fma(t_1, cos(x), (t_0 * cos(y))), 1.5, 3.0) / fma(fma(cos(x), -0.0625, 0.0625), (sqrt(2.0) * t_2), 2.0)), -1.0);
} else if (x <= 0.0014) {
tmp = fma((-0.0625 * pow(sin(y), 2.0)), ((1.0 - cos(y)) * sqrt(2.0)), 2.0) / fma(1.5, fma(cos(x), t_1, ((4.0 / (sqrt(5.0) + 3.0)) * cos(y))), 3.0);
} else {
tmp = (0.3333333333333333 / fma((0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0))) * fma(fma(-0.0625, cos(x), 0.0625), (t_2 * sqrt(2.0)), 2.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(3.0 - sqrt(5.0)) t_1 = Float64(sqrt(5.0) - 1.0) t_2 = sin(x) ^ 2.0 tmp = 0.0 if (x <= -0.00071) tmp = Float64(fma(fma(t_1, cos(x), Float64(t_0 * cos(y))), 1.5, 3.0) / fma(fma(cos(x), -0.0625, 0.0625), Float64(sqrt(2.0) * t_2), 2.0)) ^ -1.0; elseif (x <= 0.0014) tmp = Float64(fma(Float64(-0.0625 * (sin(y) ^ 2.0)), Float64(Float64(1.0 - cos(y)) * sqrt(2.0)), 2.0) / fma(1.5, fma(cos(x), t_1, Float64(Float64(4.0 / Float64(sqrt(5.0) + 3.0)) * cos(y))), 3.0)); else tmp = Float64(Float64(0.3333333333333333 / fma(Float64(0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0))) * fma(fma(-0.0625, cos(x), 0.0625), Float64(t_2 * sqrt(2.0)), 2.0)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[x, -0.00071], N[Power[N[(N[(N[(t$95$1 * N[Cos[x], $MachinePrecision] + N[(t$95$0 * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.5 + 3.0), $MachinePrecision] / N[(N[(N[Cos[x], $MachinePrecision] * -0.0625 + 0.0625), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * t$95$2), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], If[LessEqual[x, 0.0014], N[(N[(N[(-0.0625 * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * t$95$1 + N[(N[(4.0 / N[(N[Sqrt[5.0], $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 / N[(N[(0.5 * t$95$0), $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[(N[Sqrt[5.0], $MachinePrecision] * 0.5 + -0.5), $MachinePrecision] * N[Cos[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] * N[(t$95$2 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - \sqrt{5}\\
t_1 := \sqrt{5} - 1\\
t_2 := {\sin x}^{2}\\
\mathbf{if}\;x \leq -0.00071:\\
\;\;\;\;{\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_1, \cos x, t\_0 \cdot \cos y\right), 1.5, 3\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\cos x, -0.0625, 0.0625\right), \sqrt{2} \cdot t\_2, 2\right)}\right)}^{-1}\\
\mathbf{elif}\;x \leq 0.0014:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot {\sin y}^{2}, \left(1 - \cos y\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, t\_1, \frac{4}{\sqrt{5} + 3} \cdot \cos y\right), 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{\mathsf{fma}\left(0.5 \cdot t\_0, \cos y, \mathsf{fma}\left(\mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right), \cos x, 1\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), t\_2 \cdot \sqrt{2}, 2\right)\\
\end{array}
\end{array}
if x < -7.10000000000000019e-4Initial program 98.5%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6451.1
Applied rewrites51.1%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
Applied rewrites51.1%
if -7.10000000000000019e-4 < x < 0.00139999999999999999Initial program 99.6%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f64N/A
lower-sqrt.f6498.8
Applied rewrites98.8%
if 0.00139999999999999999 < x Initial program 99.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6465.0
Applied rewrites65.0%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6465.0
Applied rewrites65.0%
Applied rewrites65.2%
Final simplification78.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 3.0 (sqrt 5.0)))
(t_1 (- (sqrt 5.0) 1.0))
(t_2 (pow (sin x) 2.0))
(t_3 (* t_0 (cos y))))
(if (<= x -0.00071)
(pow
(/
(fma (fma t_1 (cos x) t_3) 1.5 3.0)
(fma (fma (cos x) -0.0625 0.0625) (* (sqrt 2.0) t_2) 2.0))
-1.0)
(if (<= x 0.0014)
(/
(fma (* -0.0625 (pow (sin y) 2.0)) (* (- 1.0 (cos y)) (sqrt 2.0)) 2.0)
(fma 1.5 (fma (cos x) t_1 t_3) 3.0))
(*
(/
0.3333333333333333
(fma (* 0.5 t_0) (cos y) (fma (fma (sqrt 5.0) 0.5 -0.5) (cos x) 1.0)))
(fma (fma -0.0625 (cos x) 0.0625) (* t_2 (sqrt 2.0)) 2.0))))))
double code(double x, double y) {
double t_0 = 3.0 - sqrt(5.0);
double t_1 = sqrt(5.0) - 1.0;
double t_2 = pow(sin(x), 2.0);
double t_3 = t_0 * cos(y);
double tmp;
if (x <= -0.00071) {
tmp = pow((fma(fma(t_1, cos(x), t_3), 1.5, 3.0) / fma(fma(cos(x), -0.0625, 0.0625), (sqrt(2.0) * t_2), 2.0)), -1.0);
} else if (x <= 0.0014) {
tmp = fma((-0.0625 * pow(sin(y), 2.0)), ((1.0 - cos(y)) * sqrt(2.0)), 2.0) / fma(1.5, fma(cos(x), t_1, t_3), 3.0);
} else {
tmp = (0.3333333333333333 / fma((0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0))) * fma(fma(-0.0625, cos(x), 0.0625), (t_2 * sqrt(2.0)), 2.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(3.0 - sqrt(5.0)) t_1 = Float64(sqrt(5.0) - 1.0) t_2 = sin(x) ^ 2.0 t_3 = Float64(t_0 * cos(y)) tmp = 0.0 if (x <= -0.00071) tmp = Float64(fma(fma(t_1, cos(x), t_3), 1.5, 3.0) / fma(fma(cos(x), -0.0625, 0.0625), Float64(sqrt(2.0) * t_2), 2.0)) ^ -1.0; elseif (x <= 0.0014) tmp = Float64(fma(Float64(-0.0625 * (sin(y) ^ 2.0)), Float64(Float64(1.0 - cos(y)) * sqrt(2.0)), 2.0) / fma(1.5, fma(cos(x), t_1, t_3), 3.0)); else tmp = Float64(Float64(0.3333333333333333 / fma(Float64(0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0))) * fma(fma(-0.0625, cos(x), 0.0625), Float64(t_2 * sqrt(2.0)), 2.0)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.00071], N[Power[N[(N[(N[(t$95$1 * N[Cos[x], $MachinePrecision] + t$95$3), $MachinePrecision] * 1.5 + 3.0), $MachinePrecision] / N[(N[(N[Cos[x], $MachinePrecision] * -0.0625 + 0.0625), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * t$95$2), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], If[LessEqual[x, 0.0014], N[(N[(N[(-0.0625 * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * t$95$1 + t$95$3), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 / N[(N[(0.5 * t$95$0), $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[(N[Sqrt[5.0], $MachinePrecision] * 0.5 + -0.5), $MachinePrecision] * N[Cos[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] * N[(t$95$2 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - \sqrt{5}\\
t_1 := \sqrt{5} - 1\\
t_2 := {\sin x}^{2}\\
t_3 := t\_0 \cdot \cos y\\
\mathbf{if}\;x \leq -0.00071:\\
\;\;\;\;{\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_1, \cos x, t\_3\right), 1.5, 3\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\cos x, -0.0625, 0.0625\right), \sqrt{2} \cdot t\_2, 2\right)}\right)}^{-1}\\
\mathbf{elif}\;x \leq 0.0014:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot {\sin y}^{2}, \left(1 - \cos y\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, t\_1, t\_3\right), 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{\mathsf{fma}\left(0.5 \cdot t\_0, \cos y, \mathsf{fma}\left(\mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right), \cos x, 1\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), t\_2 \cdot \sqrt{2}, 2\right)\\
\end{array}
\end{array}
if x < -7.10000000000000019e-4Initial program 98.5%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6451.1
Applied rewrites51.1%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
Applied rewrites51.1%
if -7.10000000000000019e-4 < x < 0.00139999999999999999Initial program 99.6%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f64N/A
lower-sqrt.f6498.8
Applied rewrites98.8%
if 0.00139999999999999999 < x Initial program 99.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6465.0
Applied rewrites65.0%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6465.0
Applied rewrites65.0%
Applied rewrites65.2%
Final simplification78.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 3.0 (sqrt 5.0)))
(t_1
(fma (* 0.5 t_0) (cos y) (fma (fma (sqrt 5.0) 0.5 -0.5) (cos x) 1.0)))
(t_2
(fma
(fma -0.0625 (cos x) 0.0625)
(* (pow (sin x) 2.0) (sqrt 2.0))
2.0)))
(if (<= x -0.0265)
(/ (/ t_2 t_1) 3.0)
(if (<= x 0.017)
(/
(+
2.0
(*
(*
(fma
(* (fma -0.16666666666666666 (* x x) 1.0) (sqrt 2.0))
x
(* (* -0.0625 (sin y)) (sqrt 2.0)))
(- (sin y) (/ (sin x) 16.0)))
(fma
(fma 0.041666666666666664 (* x x) -0.5)
(* x x)
(- 1.0 (cos y)))))
(*
3.0
(fma
(* (cos y) 0.5)
t_0
(fma (- (sqrt 5.0) 1.0) (fma -0.25 (* x x) 0.5) 1.0))))
(* (/ 0.3333333333333333 t_1) t_2)))))
double code(double x, double y) {
double t_0 = 3.0 - sqrt(5.0);
double t_1 = fma((0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0));
double t_2 = fma(fma(-0.0625, cos(x), 0.0625), (pow(sin(x), 2.0) * sqrt(2.0)), 2.0);
double tmp;
if (x <= -0.0265) {
tmp = (t_2 / t_1) / 3.0;
} else if (x <= 0.017) {
tmp = (2.0 + ((fma((fma(-0.16666666666666666, (x * x), 1.0) * sqrt(2.0)), x, ((-0.0625 * sin(y)) * sqrt(2.0))) * (sin(y) - (sin(x) / 16.0))) * fma(fma(0.041666666666666664, (x * x), -0.5), (x * x), (1.0 - cos(y))))) / (3.0 * fma((cos(y) * 0.5), t_0, fma((sqrt(5.0) - 1.0), fma(-0.25, (x * x), 0.5), 1.0)));
} else {
tmp = (0.3333333333333333 / t_1) * t_2;
}
return tmp;
}
function code(x, y) t_0 = Float64(3.0 - sqrt(5.0)) t_1 = fma(Float64(0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0)) t_2 = fma(fma(-0.0625, cos(x), 0.0625), Float64((sin(x) ^ 2.0) * sqrt(2.0)), 2.0) tmp = 0.0 if (x <= -0.0265) tmp = Float64(Float64(t_2 / t_1) / 3.0); elseif (x <= 0.017) tmp = Float64(Float64(2.0 + Float64(Float64(fma(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * sqrt(2.0)), x, Float64(Float64(-0.0625 * sin(y)) * sqrt(2.0))) * Float64(sin(y) - Float64(sin(x) / 16.0))) * fma(fma(0.041666666666666664, Float64(x * x), -0.5), Float64(x * x), Float64(1.0 - cos(y))))) / Float64(3.0 * fma(Float64(cos(y) * 0.5), t_0, fma(Float64(sqrt(5.0) - 1.0), fma(-0.25, Float64(x * x), 0.5), 1.0)))); else tmp = Float64(Float64(0.3333333333333333 / t_1) * t_2); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.5 * t$95$0), $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[(N[Sqrt[5.0], $MachinePrecision] * 0.5 + -0.5), $MachinePrecision] * N[Cos[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] * N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]}, If[LessEqual[x, -0.0265], N[(N[(t$95$2 / t$95$1), $MachinePrecision] / 3.0), $MachinePrecision], If[LessEqual[x, 0.017], N[(N[(2.0 + N[(N[(N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * x + N[(N[(-0.0625 * N[Sin[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.041666666666666664 * N[(x * x), $MachinePrecision] + -0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(N[(N[Cos[y], $MachinePrecision] * 0.5), $MachinePrecision] * t$95$0 + N[(N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] * N[(-0.25 * N[(x * x), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 / t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - \sqrt{5}\\
t_1 := \mathsf{fma}\left(0.5 \cdot t\_0, \cos y, \mathsf{fma}\left(\mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right), \cos x, 1\right)\right)\\
t_2 := \mathsf{fma}\left(\mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), {\sin x}^{2} \cdot \sqrt{2}, 2\right)\\
\mathbf{if}\;x \leq -0.0265:\\
\;\;\;\;\frac{\frac{t\_2}{t\_1}}{3}\\
\mathbf{elif}\;x \leq 0.017:\\
\;\;\;\;\frac{2 + \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \sqrt{2}, x, \left(-0.0625 \cdot \sin y\right) \cdot \sqrt{2}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.041666666666666664, x \cdot x, -0.5\right), x \cdot x, 1 - \cos y\right)}{3 \cdot \mathsf{fma}\left(\cos y \cdot 0.5, t\_0, \mathsf{fma}\left(\sqrt{5} - 1, \mathsf{fma}\left(-0.25, x \cdot x, 0.5\right), 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{t\_1} \cdot t\_2\\
\end{array}
\end{array}
if x < -0.0264999999999999993Initial program 98.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6450.5
Applied rewrites50.5%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6450.6
Applied rewrites50.6%
Applied rewrites50.7%
if -0.0264999999999999993 < x < 0.017000000000000001Initial program 99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f6499.3
Applied rewrites99.3%
if 0.017000000000000001 < x Initial program 99.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6465.0
Applied rewrites65.0%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6465.0
Applied rewrites65.0%
Applied rewrites65.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 3.0 (sqrt 5.0)))
(t_1
(fma (* 0.5 t_0) (cos y) (fma (fma (sqrt 5.0) 0.5 -0.5) (cos x) 1.0)))
(t_2
(fma
(fma -0.0625 (cos x) 0.0625)
(* (pow (sin x) 2.0) (sqrt 2.0))
2.0)))
(if (<= x -0.0265)
(/ (/ t_2 t_1) 3.0)
(if (<= x 0.017)
(/
(+
2.0
(*
(*
(fma
(* (fma -0.16666666666666666 (* x x) 1.0) (sqrt 2.0))
x
(* (* -0.0625 (sin y)) (sqrt 2.0)))
(- (sin y) (/ (sin x) 16.0)))
(fma -0.5 (* x x) (- 1.0 (cos y)))))
(*
3.0
(fma
(* (cos y) 0.5)
t_0
(fma (- (sqrt 5.0) 1.0) (fma -0.25 (* x x) 0.5) 1.0))))
(* (/ 0.3333333333333333 t_1) t_2)))))
double code(double x, double y) {
double t_0 = 3.0 - sqrt(5.0);
double t_1 = fma((0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0));
double t_2 = fma(fma(-0.0625, cos(x), 0.0625), (pow(sin(x), 2.0) * sqrt(2.0)), 2.0);
double tmp;
if (x <= -0.0265) {
tmp = (t_2 / t_1) / 3.0;
} else if (x <= 0.017) {
tmp = (2.0 + ((fma((fma(-0.16666666666666666, (x * x), 1.0) * sqrt(2.0)), x, ((-0.0625 * sin(y)) * sqrt(2.0))) * (sin(y) - (sin(x) / 16.0))) * fma(-0.5, (x * x), (1.0 - cos(y))))) / (3.0 * fma((cos(y) * 0.5), t_0, fma((sqrt(5.0) - 1.0), fma(-0.25, (x * x), 0.5), 1.0)));
} else {
tmp = (0.3333333333333333 / t_1) * t_2;
}
return tmp;
}
function code(x, y) t_0 = Float64(3.0 - sqrt(5.0)) t_1 = fma(Float64(0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0)) t_2 = fma(fma(-0.0625, cos(x), 0.0625), Float64((sin(x) ^ 2.0) * sqrt(2.0)), 2.0) tmp = 0.0 if (x <= -0.0265) tmp = Float64(Float64(t_2 / t_1) / 3.0); elseif (x <= 0.017) tmp = Float64(Float64(2.0 + Float64(Float64(fma(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * sqrt(2.0)), x, Float64(Float64(-0.0625 * sin(y)) * sqrt(2.0))) * Float64(sin(y) - Float64(sin(x) / 16.0))) * fma(-0.5, Float64(x * x), Float64(1.0 - cos(y))))) / Float64(3.0 * fma(Float64(cos(y) * 0.5), t_0, fma(Float64(sqrt(5.0) - 1.0), fma(-0.25, Float64(x * x), 0.5), 1.0)))); else tmp = Float64(Float64(0.3333333333333333 / t_1) * t_2); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.5 * t$95$0), $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[(N[Sqrt[5.0], $MachinePrecision] * 0.5 + -0.5), $MachinePrecision] * N[Cos[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] * N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]}, If[LessEqual[x, -0.0265], N[(N[(t$95$2 / t$95$1), $MachinePrecision] / 3.0), $MachinePrecision], If[LessEqual[x, 0.017], N[(N[(2.0 + N[(N[(N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * x + N[(N[(-0.0625 * N[Sin[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(x * x), $MachinePrecision] + N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(N[(N[Cos[y], $MachinePrecision] * 0.5), $MachinePrecision] * t$95$0 + N[(N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] * N[(-0.25 * N[(x * x), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 / t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - \sqrt{5}\\
t_1 := \mathsf{fma}\left(0.5 \cdot t\_0, \cos y, \mathsf{fma}\left(\mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right), \cos x, 1\right)\right)\\
t_2 := \mathsf{fma}\left(\mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), {\sin x}^{2} \cdot \sqrt{2}, 2\right)\\
\mathbf{if}\;x \leq -0.0265:\\
\;\;\;\;\frac{\frac{t\_2}{t\_1}}{3}\\
\mathbf{elif}\;x \leq 0.017:\\
\;\;\;\;\frac{2 + \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \sqrt{2}, x, \left(-0.0625 \cdot \sin y\right) \cdot \sqrt{2}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \mathsf{fma}\left(-0.5, x \cdot x, 1 - \cos y\right)}{3 \cdot \mathsf{fma}\left(\cos y \cdot 0.5, t\_0, \mathsf{fma}\left(\sqrt{5} - 1, \mathsf{fma}\left(-0.25, x \cdot x, 0.5\right), 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{t\_1} \cdot t\_2\\
\end{array}
\end{array}
if x < -0.0264999999999999993Initial program 98.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6450.5
Applied rewrites50.5%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6450.6
Applied rewrites50.6%
Applied rewrites50.7%
if -0.0264999999999999993 < x < 0.017000000000000001Initial program 99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f6499.3
Applied rewrites99.3%
if 0.017000000000000001 < x Initial program 99.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6465.0
Applied rewrites65.0%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6465.0
Applied rewrites65.0%
Applied rewrites65.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 3.0 (sqrt 5.0)))
(t_1
(fma (* 0.5 t_0) (cos y) (fma (fma (sqrt 5.0) 0.5 -0.5) (cos x) 1.0)))
(t_2
(fma
(fma -0.0625 (cos x) 0.0625)
(* (pow (sin x) 2.0) (sqrt 2.0))
2.0)))
(if (<= x -0.0076)
(/ (/ t_2 t_1) 3.0)
(if (<= x 0.00155)
(/
(+
2.0
(*
(*
(fma
(* (fma -0.16666666666666666 (* x x) 1.0) (sqrt 2.0))
x
(* (* -0.0625 (sin y)) (sqrt 2.0)))
(- (sin y) (/ (sin x) 16.0)))
(- 1.0 (cos y))))
(*
3.0
(fma
(* (cos y) 0.5)
t_0
(fma (- (sqrt 5.0) 1.0) (fma -0.25 (* x x) 0.5) 1.0))))
(* (/ 0.3333333333333333 t_1) t_2)))))
double code(double x, double y) {
double t_0 = 3.0 - sqrt(5.0);
double t_1 = fma((0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0));
double t_2 = fma(fma(-0.0625, cos(x), 0.0625), (pow(sin(x), 2.0) * sqrt(2.0)), 2.0);
double tmp;
if (x <= -0.0076) {
tmp = (t_2 / t_1) / 3.0;
} else if (x <= 0.00155) {
tmp = (2.0 + ((fma((fma(-0.16666666666666666, (x * x), 1.0) * sqrt(2.0)), x, ((-0.0625 * sin(y)) * sqrt(2.0))) * (sin(y) - (sin(x) / 16.0))) * (1.0 - cos(y)))) / (3.0 * fma((cos(y) * 0.5), t_0, fma((sqrt(5.0) - 1.0), fma(-0.25, (x * x), 0.5), 1.0)));
} else {
tmp = (0.3333333333333333 / t_1) * t_2;
}
return tmp;
}
function code(x, y) t_0 = Float64(3.0 - sqrt(5.0)) t_1 = fma(Float64(0.5 * t_0), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0)) t_2 = fma(fma(-0.0625, cos(x), 0.0625), Float64((sin(x) ^ 2.0) * sqrt(2.0)), 2.0) tmp = 0.0 if (x <= -0.0076) tmp = Float64(Float64(t_2 / t_1) / 3.0); elseif (x <= 0.00155) tmp = Float64(Float64(2.0 + Float64(Float64(fma(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * sqrt(2.0)), x, Float64(Float64(-0.0625 * sin(y)) * sqrt(2.0))) * Float64(sin(y) - Float64(sin(x) / 16.0))) * Float64(1.0 - cos(y)))) / Float64(3.0 * fma(Float64(cos(y) * 0.5), t_0, fma(Float64(sqrt(5.0) - 1.0), fma(-0.25, Float64(x * x), 0.5), 1.0)))); else tmp = Float64(Float64(0.3333333333333333 / t_1) * t_2); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.5 * t$95$0), $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[(N[Sqrt[5.0], $MachinePrecision] * 0.5 + -0.5), $MachinePrecision] * N[Cos[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] * N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]}, If[LessEqual[x, -0.0076], N[(N[(t$95$2 / t$95$1), $MachinePrecision] / 3.0), $MachinePrecision], If[LessEqual[x, 0.00155], N[(N[(2.0 + N[(N[(N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * x + N[(N[(-0.0625 * N[Sin[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(N[(N[Cos[y], $MachinePrecision] * 0.5), $MachinePrecision] * t$95$0 + N[(N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] * N[(-0.25 * N[(x * x), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 / t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - \sqrt{5}\\
t_1 := \mathsf{fma}\left(0.5 \cdot t\_0, \cos y, \mathsf{fma}\left(\mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right), \cos x, 1\right)\right)\\
t_2 := \mathsf{fma}\left(\mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), {\sin x}^{2} \cdot \sqrt{2}, 2\right)\\
\mathbf{if}\;x \leq -0.0076:\\
\;\;\;\;\frac{\frac{t\_2}{t\_1}}{3}\\
\mathbf{elif}\;x \leq 0.00155:\\
\;\;\;\;\frac{2 + \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot \sqrt{2}, x, \left(-0.0625 \cdot \sin y\right) \cdot \sqrt{2}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(1 - \cos y\right)}{3 \cdot \mathsf{fma}\left(\cos y \cdot 0.5, t\_0, \mathsf{fma}\left(\sqrt{5} - 1, \mathsf{fma}\left(-0.25, x \cdot x, 0.5\right), 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{t\_1} \cdot t\_2\\
\end{array}
\end{array}
if x < -0.00759999999999999998Initial program 98.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6450.5
Applied rewrites50.5%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6450.6
Applied rewrites50.6%
Applied rewrites50.7%
if -0.00759999999999999998 < x < 0.00154999999999999995Initial program 99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.3%
Taylor expanded in x around 0
lower--.f64N/A
lower-cos.f6498.8
Applied rewrites98.8%
if 0.00154999999999999995 < x Initial program 99.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6465.0
Applied rewrites65.0%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6465.0
Applied rewrites65.0%
Applied rewrites65.2%
(FPCore (x y)
:precision binary64
(let* ((t_0
(fma
(* 0.5 (- 3.0 (sqrt 5.0)))
(cos y)
(fma (fma (sqrt 5.0) 0.5 -0.5) (cos x) 1.0)))
(t_1
(fma
(fma -0.0625 (cos x) 0.0625)
(* (pow (sin x) 2.0) (sqrt 2.0))
2.0)))
(if (<= x -0.00071)
(/ (/ t_1 t_0) 3.0)
(if (<= x 0.0014)
(/
(fma (* -0.0625 (pow (sin y) 2.0)) (* (- 1.0 (cos y)) (sqrt 2.0)) 2.0)
(fma
1.5
(fma
(cos x)
(- (sqrt 5.0) 1.0)
(* (/ 4.0 (+ (sqrt 5.0) 3.0)) (cos y)))
3.0))
(* (/ 0.3333333333333333 t_0) t_1)))))
double code(double x, double y) {
double t_0 = fma((0.5 * (3.0 - sqrt(5.0))), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0));
double t_1 = fma(fma(-0.0625, cos(x), 0.0625), (pow(sin(x), 2.0) * sqrt(2.0)), 2.0);
double tmp;
if (x <= -0.00071) {
tmp = (t_1 / t_0) / 3.0;
} else if (x <= 0.0014) {
tmp = fma((-0.0625 * pow(sin(y), 2.0)), ((1.0 - cos(y)) * sqrt(2.0)), 2.0) / fma(1.5, fma(cos(x), (sqrt(5.0) - 1.0), ((4.0 / (sqrt(5.0) + 3.0)) * cos(y))), 3.0);
} else {
tmp = (0.3333333333333333 / t_0) * t_1;
}
return tmp;
}
function code(x, y) t_0 = fma(Float64(0.5 * Float64(3.0 - sqrt(5.0))), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0)) t_1 = fma(fma(-0.0625, cos(x), 0.0625), Float64((sin(x) ^ 2.0) * sqrt(2.0)), 2.0) tmp = 0.0 if (x <= -0.00071) tmp = Float64(Float64(t_1 / t_0) / 3.0); elseif (x <= 0.0014) tmp = Float64(fma(Float64(-0.0625 * (sin(y) ^ 2.0)), Float64(Float64(1.0 - cos(y)) * sqrt(2.0)), 2.0) / fma(1.5, fma(cos(x), Float64(sqrt(5.0) - 1.0), Float64(Float64(4.0 / Float64(sqrt(5.0) + 3.0)) * cos(y))), 3.0)); else tmp = Float64(Float64(0.3333333333333333 / t_0) * t_1); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(0.5 * N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[(N[Sqrt[5.0], $MachinePrecision] * 0.5 + -0.5), $MachinePrecision] * N[Cos[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] * N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]}, If[LessEqual[x, -0.00071], N[(N[(t$95$1 / t$95$0), $MachinePrecision] / 3.0), $MachinePrecision], If[LessEqual[x, 0.0014], N[(N[(N[(-0.0625 * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] + N[(N[(4.0 / N[(N[Sqrt[5.0], $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 / t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.5 \cdot \left(3 - \sqrt{5}\right), \cos y, \mathsf{fma}\left(\mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right), \cos x, 1\right)\right)\\
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), {\sin x}^{2} \cdot \sqrt{2}, 2\right)\\
\mathbf{if}\;x \leq -0.00071:\\
\;\;\;\;\frac{\frac{t\_1}{t\_0}}{3}\\
\mathbf{elif}\;x \leq 0.0014:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot {\sin y}^{2}, \left(1 - \cos y\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, \sqrt{5} - 1, \frac{4}{\sqrt{5} + 3} \cdot \cos y\right), 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{t\_0} \cdot t\_1\\
\end{array}
\end{array}
if x < -7.10000000000000019e-4Initial program 98.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6450.9
Applied rewrites50.9%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6451.0
Applied rewrites51.0%
Applied rewrites51.1%
if -7.10000000000000019e-4 < x < 0.00139999999999999999Initial program 99.6%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f64N/A
lower-sqrt.f6498.8
Applied rewrites98.8%
if 0.00139999999999999999 < x Initial program 99.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6465.0
Applied rewrites65.0%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6465.0
Applied rewrites65.0%
Applied rewrites65.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (pow (sin x) 2.0) (sqrt 2.0)))
(t_1 (- 3.0 (sqrt 5.0)))
(t_2 (fma 1.5 (fma (cos x) (- (sqrt 5.0) 1.0) (* t_1 (cos y))) 3.0))
(t_3 (fma -0.0625 (cos x) 0.0625)))
(if (<= x -0.00071)
(/ (fma t_0 t_3 2.0) t_2)
(if (<= x 0.0014)
(/
(fma (* -0.0625 (pow (sin y) 2.0)) (* (- 1.0 (cos y)) (sqrt 2.0)) 2.0)
t_2)
(*
(/
0.3333333333333333
(fma (* 0.5 t_1) (cos y) (fma (fma (sqrt 5.0) 0.5 -0.5) (cos x) 1.0)))
(fma t_3 t_0 2.0))))))
double code(double x, double y) {
double t_0 = pow(sin(x), 2.0) * sqrt(2.0);
double t_1 = 3.0 - sqrt(5.0);
double t_2 = fma(1.5, fma(cos(x), (sqrt(5.0) - 1.0), (t_1 * cos(y))), 3.0);
double t_3 = fma(-0.0625, cos(x), 0.0625);
double tmp;
if (x <= -0.00071) {
tmp = fma(t_0, t_3, 2.0) / t_2;
} else if (x <= 0.0014) {
tmp = fma((-0.0625 * pow(sin(y), 2.0)), ((1.0 - cos(y)) * sqrt(2.0)), 2.0) / t_2;
} else {
tmp = (0.3333333333333333 / fma((0.5 * t_1), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0))) * fma(t_3, t_0, 2.0);
}
return tmp;
}
function code(x, y) t_0 = Float64((sin(x) ^ 2.0) * sqrt(2.0)) t_1 = Float64(3.0 - sqrt(5.0)) t_2 = fma(1.5, fma(cos(x), Float64(sqrt(5.0) - 1.0), Float64(t_1 * cos(y))), 3.0) t_3 = fma(-0.0625, cos(x), 0.0625) tmp = 0.0 if (x <= -0.00071) tmp = Float64(fma(t_0, t_3, 2.0) / t_2); elseif (x <= 0.0014) tmp = Float64(fma(Float64(-0.0625 * (sin(y) ^ 2.0)), Float64(Float64(1.0 - cos(y)) * sqrt(2.0)), 2.0) / t_2); else tmp = Float64(Float64(0.3333333333333333 / fma(Float64(0.5 * t_1), cos(y), fma(fma(sqrt(5.0), 0.5, -0.5), cos(x), 1.0))) * fma(t_3, t_0, 2.0)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.5 * N[(N[Cos[x], $MachinePrecision] * N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] + N[(t$95$1 * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]}, Block[{t$95$3 = N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision]}, If[LessEqual[x, -0.00071], N[(N[(t$95$0 * t$95$3 + 2.0), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[x, 0.0014], N[(N[(N[(-0.0625 * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(0.3333333333333333 / N[(N[(0.5 * t$95$1), $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[(N[Sqrt[5.0], $MachinePrecision] * 0.5 + -0.5), $MachinePrecision] * N[Cos[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 * t$95$0 + 2.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\sin x}^{2} \cdot \sqrt{2}\\
t_1 := 3 - \sqrt{5}\\
t_2 := \mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, \sqrt{5} - 1, t\_1 \cdot \cos y\right), 3\right)\\
t_3 := \mathsf{fma}\left(-0.0625, \cos x, 0.0625\right)\\
\mathbf{if}\;x \leq -0.00071:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_0, t\_3, 2\right)}{t\_2}\\
\mathbf{elif}\;x \leq 0.0014:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot {\sin y}^{2}, \left(1 - \cos y\right) \cdot \sqrt{2}, 2\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{\mathsf{fma}\left(0.5 \cdot t\_1, \cos y, \mathsf{fma}\left(\mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right), \cos x, 1\right)\right)} \cdot \mathsf{fma}\left(t\_3, t\_0, 2\right)\\
\end{array}
\end{array}
if x < -7.10000000000000019e-4Initial program 98.5%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6451.1
Applied rewrites51.1%
if -7.10000000000000019e-4 < x < 0.00139999999999999999Initial program 99.6%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f64N/A
lower-sqrt.f6498.8
Applied rewrites98.8%
if 0.00139999999999999999 < x Initial program 99.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6465.0
Applied rewrites65.0%
lift-/.f64N/A
div-invN/A
lift--.f64N/A
flip--N/A
metadata-evalN/A
associate-*l/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6465.0
Applied rewrites65.0%
Applied rewrites65.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (sqrt 5.0) 1.0)) (t_1 (- 3.0 (sqrt 5.0))))
(if (or (<= y -5e-6) (not (<= y 1.5e-5)))
(/
(fma (* -0.0625 (pow (sin y) 2.0)) (* (- 1.0 (cos y)) (sqrt 2.0)) 2.0)
(fma 1.5 (fma (cos x) t_0 (* t_1 (cos y))) 3.0))
(*
(/
(fma (* -0.0625 (pow (sin x) 2.0)) (* (- (cos x) 1.0) (sqrt 2.0)) 2.0)
(fma 0.5 (fma t_0 (cos x) t_1) 1.0))
0.3333333333333333))))
double code(double x, double y) {
double t_0 = sqrt(5.0) - 1.0;
double t_1 = 3.0 - sqrt(5.0);
double tmp;
if ((y <= -5e-6) || !(y <= 1.5e-5)) {
tmp = fma((-0.0625 * pow(sin(y), 2.0)), ((1.0 - cos(y)) * sqrt(2.0)), 2.0) / fma(1.5, fma(cos(x), t_0, (t_1 * cos(y))), 3.0);
} else {
tmp = (fma((-0.0625 * pow(sin(x), 2.0)), ((cos(x) - 1.0) * sqrt(2.0)), 2.0) / fma(0.5, fma(t_0, cos(x), t_1), 1.0)) * 0.3333333333333333;
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) - 1.0) t_1 = Float64(3.0 - sqrt(5.0)) tmp = 0.0 if ((y <= -5e-6) || !(y <= 1.5e-5)) tmp = Float64(fma(Float64(-0.0625 * (sin(y) ^ 2.0)), Float64(Float64(1.0 - cos(y)) * sqrt(2.0)), 2.0) / fma(1.5, fma(cos(x), t_0, Float64(t_1 * cos(y))), 3.0)); else tmp = Float64(Float64(fma(Float64(-0.0625 * (sin(x) ^ 2.0)), Float64(Float64(cos(x) - 1.0) * sqrt(2.0)), 2.0) / fma(0.5, fma(t_0, cos(x), t_1), 1.0)) * 0.3333333333333333); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -5e-6], N[Not[LessEqual[y, 1.5e-5]], $MachinePrecision]], N[(N[(N[(-0.0625 * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * t$95$0 + N[(t$95$1 * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-0.0625 * N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] - 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(0.5 * N[(t$95$0 * N[Cos[x], $MachinePrecision] + t$95$1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{5} - 1\\
t_1 := 3 - \sqrt{5}\\
\mathbf{if}\;y \leq -5 \cdot 10^{-6} \lor \neg \left(y \leq 1.5 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot {\sin y}^{2}, \left(1 - \cos y\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, t\_0, t\_1 \cdot \cos y\right), 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot {\sin x}^{2}, \left(\cos x - 1\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(t\_0, \cos x, t\_1\right), 1\right)} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -5.00000000000000041e-6 or 1.50000000000000004e-5 < y Initial program 99.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.1%
Taylor expanded in x around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f64N/A
lower-sqrt.f6461.0
Applied rewrites61.0%
if -5.00000000000000041e-6 < y < 1.50000000000000004e-5Initial program 99.5%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.5%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.1%
Final simplification78.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (sqrt 5.0) 1.0)) (t_1 (- 3.0 (sqrt 5.0))))
(if (or (<= x -0.0033) (not (<= x 0.00142)))
(/
(fma (* (pow (sin x) 2.0) (sqrt 2.0)) (fma -0.0625 (cos x) 0.0625) 2.0)
(fma 1.5 (fma (cos x) t_0 (* t_1 (cos y))) 3.0))
(/
(fma (* -0.0625 (pow (sin y) 2.0)) (* (- 1.0 (cos y)) (sqrt 2.0)) 2.0)
(*
3.0
(fma (* (cos y) 0.5) t_1 (fma t_0 (fma -0.25 (* x x) 0.5) 1.0)))))))
double code(double x, double y) {
double t_0 = sqrt(5.0) - 1.0;
double t_1 = 3.0 - sqrt(5.0);
double tmp;
if ((x <= -0.0033) || !(x <= 0.00142)) {
tmp = fma((pow(sin(x), 2.0) * sqrt(2.0)), fma(-0.0625, cos(x), 0.0625), 2.0) / fma(1.5, fma(cos(x), t_0, (t_1 * cos(y))), 3.0);
} else {
tmp = fma((-0.0625 * pow(sin(y), 2.0)), ((1.0 - cos(y)) * sqrt(2.0)), 2.0) / (3.0 * fma((cos(y) * 0.5), t_1, fma(t_0, fma(-0.25, (x * x), 0.5), 1.0)));
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) - 1.0) t_1 = Float64(3.0 - sqrt(5.0)) tmp = 0.0 if ((x <= -0.0033) || !(x <= 0.00142)) tmp = Float64(fma(Float64((sin(x) ^ 2.0) * sqrt(2.0)), fma(-0.0625, cos(x), 0.0625), 2.0) / fma(1.5, fma(cos(x), t_0, Float64(t_1 * cos(y))), 3.0)); else tmp = Float64(fma(Float64(-0.0625 * (sin(y) ^ 2.0)), Float64(Float64(1.0 - cos(y)) * sqrt(2.0)), 2.0) / Float64(3.0 * fma(Float64(cos(y) * 0.5), t_1, fma(t_0, fma(-0.25, Float64(x * x), 0.5), 1.0)))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -0.0033], N[Not[LessEqual[x, 0.00142]], $MachinePrecision]], N[(N[(N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] + 2.0), $MachinePrecision] / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * t$95$0 + N[(t$95$1 * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.0625 * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 * N[(N[(N[Cos[y], $MachinePrecision] * 0.5), $MachinePrecision] * t$95$1 + N[(t$95$0 * N[(-0.25 * N[(x * x), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{5} - 1\\
t_1 := 3 - \sqrt{5}\\
\mathbf{if}\;x \leq -0.0033 \lor \neg \left(x \leq 0.00142\right):\\
\;\;\;\;\frac{\mathsf{fma}\left({\sin x}^{2} \cdot \sqrt{2}, \mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), 2\right)}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, t\_0, t\_1 \cdot \cos y\right), 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot {\sin y}^{2}, \left(1 - \cos y\right) \cdot \sqrt{2}, 2\right)}{3 \cdot \mathsf{fma}\left(\cos y \cdot 0.5, t\_1, \mathsf{fma}\left(t\_0, \mathsf{fma}\left(-0.25, x \cdot x, 0.5\right), 1\right)\right)}\\
\end{array}
\end{array}
if x < -0.0033 or 0.00142000000000000004 < x Initial program 98.8%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6459.1
Applied rewrites59.1%
if -0.0033 < x < 0.00142000000000000004Initial program 99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f64N/A
lower-sqrt.f6498.1
Applied rewrites98.1%
Final simplification78.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (sqrt 5.0) 1.0))
(t_1 (* (pow (sin x) 2.0) (sqrt 2.0)))
(t_2 (- 3.0 (sqrt 5.0))))
(if (<= x -0.0033)
(/
(fma t_1 (fma -0.0625 (cos x) 0.0625) 2.0)
(fma 1.5 (fma (cos x) t_0 (* t_2 (cos y))) 3.0))
(if (<= x 0.00142)
(/
(fma (* -0.0625 (pow (sin y) 2.0)) (* (- 1.0 (cos y)) (sqrt 2.0)) 2.0)
(*
3.0
(fma (* (cos y) 0.5) t_2 (fma t_0 (fma -0.25 (* x x) 0.5) 1.0))))
(/
(fma t_1 (fma (cos x) -0.0625 0.0625) 2.0)
(fma 1.5 (fma (cos y) t_2 (* (cos x) t_0)) 3.0))))))
double code(double x, double y) {
double t_0 = sqrt(5.0) - 1.0;
double t_1 = pow(sin(x), 2.0) * sqrt(2.0);
double t_2 = 3.0 - sqrt(5.0);
double tmp;
if (x <= -0.0033) {
tmp = fma(t_1, fma(-0.0625, cos(x), 0.0625), 2.0) / fma(1.5, fma(cos(x), t_0, (t_2 * cos(y))), 3.0);
} else if (x <= 0.00142) {
tmp = fma((-0.0625 * pow(sin(y), 2.0)), ((1.0 - cos(y)) * sqrt(2.0)), 2.0) / (3.0 * fma((cos(y) * 0.5), t_2, fma(t_0, fma(-0.25, (x * x), 0.5), 1.0)));
} else {
tmp = fma(t_1, fma(cos(x), -0.0625, 0.0625), 2.0) / fma(1.5, fma(cos(y), t_2, (cos(x) * t_0)), 3.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) - 1.0) t_1 = Float64((sin(x) ^ 2.0) * sqrt(2.0)) t_2 = Float64(3.0 - sqrt(5.0)) tmp = 0.0 if (x <= -0.0033) tmp = Float64(fma(t_1, fma(-0.0625, cos(x), 0.0625), 2.0) / fma(1.5, fma(cos(x), t_0, Float64(t_2 * cos(y))), 3.0)); elseif (x <= 0.00142) tmp = Float64(fma(Float64(-0.0625 * (sin(y) ^ 2.0)), Float64(Float64(1.0 - cos(y)) * sqrt(2.0)), 2.0) / Float64(3.0 * fma(Float64(cos(y) * 0.5), t_2, fma(t_0, fma(-0.25, Float64(x * x), 0.5), 1.0)))); else tmp = Float64(fma(t_1, fma(cos(x), -0.0625, 0.0625), 2.0) / fma(1.5, fma(cos(y), t_2, Float64(cos(x) * t_0)), 3.0)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.0033], N[(N[(t$95$1 * N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] + 2.0), $MachinePrecision] / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * t$95$0 + N[(t$95$2 * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00142], N[(N[(N[(-0.0625 * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 * N[(N[(N[Cos[y], $MachinePrecision] * 0.5), $MachinePrecision] * t$95$2 + N[(t$95$0 * N[(-0.25 * N[(x * x), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * N[(N[Cos[x], $MachinePrecision] * -0.0625 + 0.0625), $MachinePrecision] + 2.0), $MachinePrecision] / N[(1.5 * N[(N[Cos[y], $MachinePrecision] * t$95$2 + N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{5} - 1\\
t_1 := {\sin x}^{2} \cdot \sqrt{2}\\
t_2 := 3 - \sqrt{5}\\
\mathbf{if}\;x \leq -0.0033:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_1, \mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), 2\right)}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, t\_0, t\_2 \cdot \cos y\right), 3\right)}\\
\mathbf{elif}\;x \leq 0.00142:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot {\sin y}^{2}, \left(1 - \cos y\right) \cdot \sqrt{2}, 2\right)}{3 \cdot \mathsf{fma}\left(\cos y \cdot 0.5, t\_2, \mathsf{fma}\left(t\_0, \mathsf{fma}\left(-0.25, x \cdot x, 0.5\right), 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_1, \mathsf{fma}\left(\cos x, -0.0625, 0.0625\right), 2\right)}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos y, t\_2, \cos x \cdot t\_0\right), 3\right)}\\
\end{array}
\end{array}
if x < -0.0033Initial program 98.5%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6450.7
Applied rewrites50.7%
if -0.0033 < x < 0.00142000000000000004Initial program 99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f64N/A
lower-sqrt.f6498.1
Applied rewrites98.1%
if 0.00142000000000000004 < x Initial program 99.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6465.0
Applied rewrites65.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites65.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (sqrt 5.0) 1.0))
(t_1 (- 3.0 (sqrt 5.0)))
(t_2 (pow (sin x) 2.0)))
(if (<= x -0.00022)
(*
(/
(fma (* t_2 (sqrt 2.0)) (fma -0.0625 (cos x) 0.0625) 2.0)
(fma 0.5 (fma (cos x) t_0 t_1) 1.0))
0.3333333333333333)
(if (<= x 0.00043)
(pow
(/
(fma (fma t_1 (cos y) t_0) 1.5 3.0)
(fma
(* -0.0625 (pow (sin y) 2.0))
(* (- 1.0 (cos y)) (sqrt 2.0))
2.0))
-1.0)
(*
(/
(fma (* -0.0625 t_2) (* (- (cos x) 1.0) (sqrt 2.0)) 2.0)
(fma 0.5 (fma t_0 (cos x) t_1) 1.0))
0.3333333333333333)))))
double code(double x, double y) {
double t_0 = sqrt(5.0) - 1.0;
double t_1 = 3.0 - sqrt(5.0);
double t_2 = pow(sin(x), 2.0);
double tmp;
if (x <= -0.00022) {
tmp = (fma((t_2 * sqrt(2.0)), fma(-0.0625, cos(x), 0.0625), 2.0) / fma(0.5, fma(cos(x), t_0, t_1), 1.0)) * 0.3333333333333333;
} else if (x <= 0.00043) {
tmp = pow((fma(fma(t_1, cos(y), t_0), 1.5, 3.0) / fma((-0.0625 * pow(sin(y), 2.0)), ((1.0 - cos(y)) * sqrt(2.0)), 2.0)), -1.0);
} else {
tmp = (fma((-0.0625 * t_2), ((cos(x) - 1.0) * sqrt(2.0)), 2.0) / fma(0.5, fma(t_0, cos(x), t_1), 1.0)) * 0.3333333333333333;
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) - 1.0) t_1 = Float64(3.0 - sqrt(5.0)) t_2 = sin(x) ^ 2.0 tmp = 0.0 if (x <= -0.00022) tmp = Float64(Float64(fma(Float64(t_2 * sqrt(2.0)), fma(-0.0625, cos(x), 0.0625), 2.0) / fma(0.5, fma(cos(x), t_0, t_1), 1.0)) * 0.3333333333333333); elseif (x <= 0.00043) tmp = Float64(fma(fma(t_1, cos(y), t_0), 1.5, 3.0) / fma(Float64(-0.0625 * (sin(y) ^ 2.0)), Float64(Float64(1.0 - cos(y)) * sqrt(2.0)), 2.0)) ^ -1.0; else tmp = Float64(Float64(fma(Float64(-0.0625 * t_2), Float64(Float64(cos(x) - 1.0) * sqrt(2.0)), 2.0) / fma(0.5, fma(t_0, cos(x), t_1), 1.0)) * 0.3333333333333333); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[x, -0.00022], N[(N[(N[(N[(t$95$2 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] + 2.0), $MachinePrecision] / N[(0.5 * N[(N[Cos[x], $MachinePrecision] * t$95$0 + t$95$1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], If[LessEqual[x, 0.00043], N[Power[N[(N[(N[(t$95$1 * N[Cos[y], $MachinePrecision] + t$95$0), $MachinePrecision] * 1.5 + 3.0), $MachinePrecision] / N[(N[(-0.0625 * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], N[(N[(N[(N[(-0.0625 * t$95$2), $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] - 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(0.5 * N[(t$95$0 * N[Cos[x], $MachinePrecision] + t$95$1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{5} - 1\\
t_1 := 3 - \sqrt{5}\\
t_2 := {\sin x}^{2}\\
\mathbf{if}\;x \leq -0.00022:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_2 \cdot \sqrt{2}, \mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), 2\right)}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos x, t\_0, t\_1\right), 1\right)} \cdot 0.3333333333333333\\
\mathbf{elif}\;x \leq 0.00043:\\
\;\;\;\;{\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_1, \cos y, t\_0\right), 1.5, 3\right)}{\mathsf{fma}\left(-0.0625 \cdot {\sin y}^{2}, \left(1 - \cos y\right) \cdot \sqrt{2}, 2\right)}\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot t\_2, \left(\cos x - 1\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(t\_0, \cos x, t\_1\right), 1\right)} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < -2.20000000000000008e-4Initial program 98.5%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites49.5%
if -2.20000000000000008e-4 < x < 4.29999999999999989e-4Initial program 99.6%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.5%
Taylor expanded in x around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites98.7%
if 4.29999999999999989e-4 < x Initial program 99.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.1%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites56.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.5%
Final simplification78.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (sqrt 5.0) 1.0))
(t_1 (- 3.0 (sqrt 5.0)))
(t_2 (pow (sin x) 2.0)))
(if (<= x -0.0033)
(*
(/
(fma (* t_2 (sqrt 2.0)) (fma -0.0625 (cos x) 0.0625) 2.0)
(fma 0.5 (fma (cos x) t_0 t_1) 1.0))
0.3333333333333333)
(if (<= x 0.0015)
(/
(fma (* -0.0625 (pow (sin y) 2.0)) (* (- 1.0 (cos y)) (sqrt 2.0)) 2.0)
(*
3.0
(fma (* (cos y) 0.5) t_1 (fma t_0 (fma -0.25 (* x x) 0.5) 1.0))))
(*
(/
(fma (* -0.0625 t_2) (* (- (cos x) 1.0) (sqrt 2.0)) 2.0)
(fma 0.5 (fma t_0 (cos x) t_1) 1.0))
0.3333333333333333)))))
double code(double x, double y) {
double t_0 = sqrt(5.0) - 1.0;
double t_1 = 3.0 - sqrt(5.0);
double t_2 = pow(sin(x), 2.0);
double tmp;
if (x <= -0.0033) {
tmp = (fma((t_2 * sqrt(2.0)), fma(-0.0625, cos(x), 0.0625), 2.0) / fma(0.5, fma(cos(x), t_0, t_1), 1.0)) * 0.3333333333333333;
} else if (x <= 0.0015) {
tmp = fma((-0.0625 * pow(sin(y), 2.0)), ((1.0 - cos(y)) * sqrt(2.0)), 2.0) / (3.0 * fma((cos(y) * 0.5), t_1, fma(t_0, fma(-0.25, (x * x), 0.5), 1.0)));
} else {
tmp = (fma((-0.0625 * t_2), ((cos(x) - 1.0) * sqrt(2.0)), 2.0) / fma(0.5, fma(t_0, cos(x), t_1), 1.0)) * 0.3333333333333333;
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) - 1.0) t_1 = Float64(3.0 - sqrt(5.0)) t_2 = sin(x) ^ 2.0 tmp = 0.0 if (x <= -0.0033) tmp = Float64(Float64(fma(Float64(t_2 * sqrt(2.0)), fma(-0.0625, cos(x), 0.0625), 2.0) / fma(0.5, fma(cos(x), t_0, t_1), 1.0)) * 0.3333333333333333); elseif (x <= 0.0015) tmp = Float64(fma(Float64(-0.0625 * (sin(y) ^ 2.0)), Float64(Float64(1.0 - cos(y)) * sqrt(2.0)), 2.0) / Float64(3.0 * fma(Float64(cos(y) * 0.5), t_1, fma(t_0, fma(-0.25, Float64(x * x), 0.5), 1.0)))); else tmp = Float64(Float64(fma(Float64(-0.0625 * t_2), Float64(Float64(cos(x) - 1.0) * sqrt(2.0)), 2.0) / fma(0.5, fma(t_0, cos(x), t_1), 1.0)) * 0.3333333333333333); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[x, -0.0033], N[(N[(N[(N[(t$95$2 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] + 2.0), $MachinePrecision] / N[(0.5 * N[(N[Cos[x], $MachinePrecision] * t$95$0 + t$95$1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], If[LessEqual[x, 0.0015], N[(N[(N[(-0.0625 * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 * N[(N[(N[Cos[y], $MachinePrecision] * 0.5), $MachinePrecision] * t$95$1 + N[(t$95$0 * N[(-0.25 * N[(x * x), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-0.0625 * t$95$2), $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] - 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(0.5 * N[(t$95$0 * N[Cos[x], $MachinePrecision] + t$95$1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{5} - 1\\
t_1 := 3 - \sqrt{5}\\
t_2 := {\sin x}^{2}\\
\mathbf{if}\;x \leq -0.0033:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_2 \cdot \sqrt{2}, \mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), 2\right)}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos x, t\_0, t\_1\right), 1\right)} \cdot 0.3333333333333333\\
\mathbf{elif}\;x \leq 0.0015:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot {\sin y}^{2}, \left(1 - \cos y\right) \cdot \sqrt{2}, 2\right)}{3 \cdot \mathsf{fma}\left(\cos y \cdot 0.5, t\_1, \mathsf{fma}\left(t\_0, \mathsf{fma}\left(-0.25, x \cdot x, 0.5\right), 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot t\_2, \left(\cos x - 1\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(t\_0, \cos x, t\_1\right), 1\right)} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < -0.0033Initial program 98.5%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites49.0%
if -0.0033 < x < 0.0015Initial program 99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites99.3%
Taylor expanded in x around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-cos.f64N/A
lower-sqrt.f6498.1
Applied rewrites98.1%
if 0.0015 < x Initial program 99.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.1%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites56.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (sqrt 5.0) 1.0))
(t_1 (- 3.0 (sqrt 5.0)))
(t_2 (pow (sin x) 2.0)))
(if (<= x -0.00022)
(*
(/
(fma (* t_2 (sqrt 2.0)) (fma -0.0625 (cos x) 0.0625) 2.0)
(fma 0.5 (fma (cos x) t_0 t_1) 1.0))
0.3333333333333333)
(if (<= x 0.00043)
(*
(/
(fma (* -0.0625 (pow (sin y) 2.0)) (* (- 1.0 (cos y)) (sqrt 2.0)) 2.0)
(fma 0.5 (fma (cos y) t_1 t_0) 1.0))
0.3333333333333333)
(*
(/
(fma (* -0.0625 t_2) (* (- (cos x) 1.0) (sqrt 2.0)) 2.0)
(fma 0.5 (fma t_0 (cos x) t_1) 1.0))
0.3333333333333333)))))
double code(double x, double y) {
double t_0 = sqrt(5.0) - 1.0;
double t_1 = 3.0 - sqrt(5.0);
double t_2 = pow(sin(x), 2.0);
double tmp;
if (x <= -0.00022) {
tmp = (fma((t_2 * sqrt(2.0)), fma(-0.0625, cos(x), 0.0625), 2.0) / fma(0.5, fma(cos(x), t_0, t_1), 1.0)) * 0.3333333333333333;
} else if (x <= 0.00043) {
tmp = (fma((-0.0625 * pow(sin(y), 2.0)), ((1.0 - cos(y)) * sqrt(2.0)), 2.0) / fma(0.5, fma(cos(y), t_1, t_0), 1.0)) * 0.3333333333333333;
} else {
tmp = (fma((-0.0625 * t_2), ((cos(x) - 1.0) * sqrt(2.0)), 2.0) / fma(0.5, fma(t_0, cos(x), t_1), 1.0)) * 0.3333333333333333;
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) - 1.0) t_1 = Float64(3.0 - sqrt(5.0)) t_2 = sin(x) ^ 2.0 tmp = 0.0 if (x <= -0.00022) tmp = Float64(Float64(fma(Float64(t_2 * sqrt(2.0)), fma(-0.0625, cos(x), 0.0625), 2.0) / fma(0.5, fma(cos(x), t_0, t_1), 1.0)) * 0.3333333333333333); elseif (x <= 0.00043) tmp = Float64(Float64(fma(Float64(-0.0625 * (sin(y) ^ 2.0)), Float64(Float64(1.0 - cos(y)) * sqrt(2.0)), 2.0) / fma(0.5, fma(cos(y), t_1, t_0), 1.0)) * 0.3333333333333333); else tmp = Float64(Float64(fma(Float64(-0.0625 * t_2), Float64(Float64(cos(x) - 1.0) * sqrt(2.0)), 2.0) / fma(0.5, fma(t_0, cos(x), t_1), 1.0)) * 0.3333333333333333); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[x, -0.00022], N[(N[(N[(N[(t$95$2 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] + 2.0), $MachinePrecision] / N[(0.5 * N[(N[Cos[x], $MachinePrecision] * t$95$0 + t$95$1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], If[LessEqual[x, 0.00043], N[(N[(N[(N[(-0.0625 * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(0.5 * N[(N[Cos[y], $MachinePrecision] * t$95$1 + t$95$0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(N[(N[(N[(-0.0625 * t$95$2), $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] - 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(0.5 * N[(t$95$0 * N[Cos[x], $MachinePrecision] + t$95$1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{5} - 1\\
t_1 := 3 - \sqrt{5}\\
t_2 := {\sin x}^{2}\\
\mathbf{if}\;x \leq -0.00022:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_2 \cdot \sqrt{2}, \mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), 2\right)}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos x, t\_0, t\_1\right), 1\right)} \cdot 0.3333333333333333\\
\mathbf{elif}\;x \leq 0.00043:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot {\sin y}^{2}, \left(1 - \cos y\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos y, t\_1, t\_0\right), 1\right)} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot t\_2, \left(\cos x - 1\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(t\_0, \cos x, t\_1\right), 1\right)} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < -2.20000000000000008e-4Initial program 98.5%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites49.5%
if -2.20000000000000008e-4 < x < 4.29999999999999989e-4Initial program 99.6%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.6%
if 4.29999999999999989e-4 < x Initial program 99.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.1%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites56.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (sqrt 5.0) 1.0)) (t_1 (- 3.0 (sqrt 5.0))))
(if (<= y 1.5e-5)
(*
(/
(fma (* -0.0625 (pow (sin x) 2.0)) (* (- (cos x) 1.0) (sqrt 2.0)) 2.0)
(fma 0.5 (fma t_0 (cos x) t_1) 1.0))
0.3333333333333333)
(/ 2.0 (* (fma 0.5 (fma (cos y) t_1 (* (cos x) t_0)) 1.0) 3.0)))))
double code(double x, double y) {
double t_0 = sqrt(5.0) - 1.0;
double t_1 = 3.0 - sqrt(5.0);
double tmp;
if (y <= 1.5e-5) {
tmp = (fma((-0.0625 * pow(sin(x), 2.0)), ((cos(x) - 1.0) * sqrt(2.0)), 2.0) / fma(0.5, fma(t_0, cos(x), t_1), 1.0)) * 0.3333333333333333;
} else {
tmp = 2.0 / (fma(0.5, fma(cos(y), t_1, (cos(x) * t_0)), 1.0) * 3.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) - 1.0) t_1 = Float64(3.0 - sqrt(5.0)) tmp = 0.0 if (y <= 1.5e-5) tmp = Float64(Float64(fma(Float64(-0.0625 * (sin(x) ^ 2.0)), Float64(Float64(cos(x) - 1.0) * sqrt(2.0)), 2.0) / fma(0.5, fma(t_0, cos(x), t_1), 1.0)) * 0.3333333333333333); else tmp = Float64(2.0 / Float64(fma(0.5, fma(cos(y), t_1, Float64(cos(x) * t_0)), 1.0) * 3.0)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.5e-5], N[(N[(N[(N[(-0.0625 * N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] - 1.0), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(0.5 * N[(t$95$0 * N[Cos[x], $MachinePrecision] + t$95$1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(2.0 / N[(N[(0.5 * N[(N[Cos[y], $MachinePrecision] * t$95$1 + N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{5} - 1\\
t_1 := 3 - \sqrt{5}\\
\mathbf{if}\;y \leq 1.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0625 \cdot {\sin x}^{2}, \left(\cos x - 1\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(t\_0, \cos x, t\_1\right), 1\right)} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos y, t\_1, \cos x \cdot t\_0\right), 1\right) \cdot 3}\\
\end{array}
\end{array}
if y < 1.50000000000000004e-5Initial program 99.3%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.3%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites69.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.1%
if 1.50000000000000004e-5 < y Initial program 98.9%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.1%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites19.6%
Taylor expanded in x around 0
Applied rewrites30.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (sqrt 5.0) 1.0)) (t_1 (- 3.0 (sqrt 5.0))))
(if (<= y 1.5e-5)
(*
(/
(fma (* (pow (sin x) 2.0) (sqrt 2.0)) (fma -0.0625 (cos x) 0.0625) 2.0)
(fma 0.5 (fma (cos x) t_0 t_1) 1.0))
0.3333333333333333)
(/ 2.0 (* (fma 0.5 (fma (cos y) t_1 (* (cos x) t_0)) 1.0) 3.0)))))
double code(double x, double y) {
double t_0 = sqrt(5.0) - 1.0;
double t_1 = 3.0 - sqrt(5.0);
double tmp;
if (y <= 1.5e-5) {
tmp = (fma((pow(sin(x), 2.0) * sqrt(2.0)), fma(-0.0625, cos(x), 0.0625), 2.0) / fma(0.5, fma(cos(x), t_0, t_1), 1.0)) * 0.3333333333333333;
} else {
tmp = 2.0 / (fma(0.5, fma(cos(y), t_1, (cos(x) * t_0)), 1.0) * 3.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) - 1.0) t_1 = Float64(3.0 - sqrt(5.0)) tmp = 0.0 if (y <= 1.5e-5) tmp = Float64(Float64(fma(Float64((sin(x) ^ 2.0) * sqrt(2.0)), fma(-0.0625, cos(x), 0.0625), 2.0) / fma(0.5, fma(cos(x), t_0, t_1), 1.0)) * 0.3333333333333333); else tmp = Float64(2.0 / Float64(fma(0.5, fma(cos(y), t_1, Float64(cos(x) * t_0)), 1.0) * 3.0)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.5e-5], N[(N[(N[(N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Cos[x], $MachinePrecision] + 0.0625), $MachinePrecision] + 2.0), $MachinePrecision] / N[(0.5 * N[(N[Cos[x], $MachinePrecision] * t$95$0 + t$95$1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(2.0 / N[(N[(0.5 * N[(N[Cos[y], $MachinePrecision] * t$95$1 + N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{5} - 1\\
t_1 := 3 - \sqrt{5}\\
\mathbf{if}\;y \leq 1.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\sin x}^{2} \cdot \sqrt{2}, \mathsf{fma}\left(-0.0625, \cos x, 0.0625\right), 2\right)}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos x, t\_0, t\_1\right), 1\right)} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos y, t\_1, \cos x \cdot t\_0\right), 1\right) \cdot 3}\\
\end{array}
\end{array}
if y < 1.50000000000000004e-5Initial program 99.3%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.3%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.1%
if 1.50000000000000004e-5 < y Initial program 98.9%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.1%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites19.6%
Taylor expanded in x around 0
Applied rewrites30.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (sqrt 5.0) 1.0)) (t_1 (- 3.0 (sqrt 5.0))))
(if (<= y 1.5e-5)
(/
(fma (* (pow (sin x) 2.0) (sqrt 2.0)) (fma (cos x) -0.0625 0.0625) 2.0)
(fma 1.5 (fma (cos x) t_0 t_1) 3.0))
(/ 2.0 (* (fma 0.5 (fma (cos y) t_1 (* (cos x) t_0)) 1.0) 3.0)))))
double code(double x, double y) {
double t_0 = sqrt(5.0) - 1.0;
double t_1 = 3.0 - sqrt(5.0);
double tmp;
if (y <= 1.5e-5) {
tmp = fma((pow(sin(x), 2.0) * sqrt(2.0)), fma(cos(x), -0.0625, 0.0625), 2.0) / fma(1.5, fma(cos(x), t_0, t_1), 3.0);
} else {
tmp = 2.0 / (fma(0.5, fma(cos(y), t_1, (cos(x) * t_0)), 1.0) * 3.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) - 1.0) t_1 = Float64(3.0 - sqrt(5.0)) tmp = 0.0 if (y <= 1.5e-5) tmp = Float64(fma(Float64((sin(x) ^ 2.0) * sqrt(2.0)), fma(cos(x), -0.0625, 0.0625), 2.0) / fma(1.5, fma(cos(x), t_0, t_1), 3.0)); else tmp = Float64(2.0 / Float64(fma(0.5, fma(cos(y), t_1, Float64(cos(x) * t_0)), 1.0) * 3.0)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.5e-5], N[(N[(N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] * -0.0625 + 0.0625), $MachinePrecision] + 2.0), $MachinePrecision] / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * t$95$0 + t$95$1), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(0.5 * N[(N[Cos[y], $MachinePrecision] * t$95$1 + N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{5} - 1\\
t_1 := 3 - \sqrt{5}\\
\mathbf{if}\;y \leq 1.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\sin x}^{2} \cdot \sqrt{2}, \mathsf{fma}\left(\cos x, -0.0625, 0.0625\right), 2\right)}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, t\_0, t\_1\right), 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos y, t\_1, \cos x \cdot t\_0\right), 1\right) \cdot 3}\\
\end{array}
\end{array}
if y < 1.50000000000000004e-5Initial program 99.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
sub-negN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f6472.4
Applied rewrites72.4%
Taylor expanded in y around 0
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower--.f64N/A
lower-sqrt.f64N/A
lower--.f64N/A
lower-sqrt.f6471.1
Applied rewrites71.1%
if 1.50000000000000004e-5 < y Initial program 98.9%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.1%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites19.6%
Taylor expanded in x around 0
Applied rewrites30.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.0%
(FPCore (x y)
:precision binary64
(/
2.0
(*
(fma
0.5
(fma (cos y) (- 3.0 (sqrt 5.0)) (* (cos x) (- (sqrt 5.0) 1.0)))
1.0)
3.0)))
double code(double x, double y) {
return 2.0 / (fma(0.5, fma(cos(y), (3.0 - sqrt(5.0)), (cos(x) * (sqrt(5.0) - 1.0))), 1.0) * 3.0);
}
function code(x, y) return Float64(2.0 / Float64(fma(0.5, fma(cos(y), Float64(3.0 - sqrt(5.0)), Float64(cos(x) * Float64(sqrt(5.0) - 1.0))), 1.0) * 3.0)) end
code[x_, y_] := N[(2.0 / N[(N[(0.5 * N[(N[Cos[y], $MachinePrecision] * N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[x], $MachinePrecision] * N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos y, 3 - \sqrt{5}, \cos x \cdot \left(\sqrt{5} - 1\right)\right), 1\right) \cdot 3}
\end{array}
Initial program 99.2%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.3%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites55.9%
Taylor expanded in x around 0
Applied rewrites44.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites44.7%
(FPCore (x y) :precision binary64 (/ 2.0 (fma 1.5 (fma (cos y) (- 3.0 (sqrt 5.0)) (* (cos x) (- (sqrt 5.0) 1.0))) 3.0)))
double code(double x, double y) {
return 2.0 / fma(1.5, fma(cos(y), (3.0 - sqrt(5.0)), (cos(x) * (sqrt(5.0) - 1.0))), 3.0);
}
function code(x, y) return Float64(2.0 / fma(1.5, fma(cos(y), Float64(3.0 - sqrt(5.0)), Float64(cos(x) * Float64(sqrt(5.0) - 1.0))), 3.0)) end
code[x_, y_] := N[(2.0 / N[(1.5 * N[(N[Cos[y], $MachinePrecision] * N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[x], $MachinePrecision] * N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos y, 3 - \sqrt{5}, \cos x \cdot \left(\sqrt{5} - 1\right)\right), 3\right)}
\end{array}
Initial program 99.2%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.3%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites55.9%
Taylor expanded in x around 0
Applied rewrites44.7%
Taylor expanded in x around inf
Applied rewrites44.7%
(FPCore (x y) :precision binary64 (/ 2.0 (* (fma 0.5 (fma (cos y) (- 3.0 (sqrt 5.0)) (- (sqrt 5.0) 1.0)) 1.0) 3.0)))
double code(double x, double y) {
return 2.0 / (fma(0.5, fma(cos(y), (3.0 - sqrt(5.0)), (sqrt(5.0) - 1.0)), 1.0) * 3.0);
}
function code(x, y) return Float64(2.0 / Float64(fma(0.5, fma(cos(y), Float64(3.0 - sqrt(5.0)), Float64(sqrt(5.0) - 1.0)), 1.0) * 3.0)) end
code[x_, y_] := N[(2.0 / N[(N[(0.5 * N[(N[Cos[y], $MachinePrecision] * N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos y, 3 - \sqrt{5}, \sqrt{5} - 1\right), 1\right) \cdot 3}
\end{array}
Initial program 99.2%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.3%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites55.9%
Taylor expanded in x around 0
Applied rewrites44.7%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-cos.f64N/A
lower--.f64N/A
lower-sqrt.f64N/A
lower--.f64N/A
lower-sqrt.f6442.1
Applied rewrites42.1%
(FPCore (x y) :precision binary64 (/ 2.0 (fma 1.5 (fma (cos y) (- 3.0 (sqrt 5.0)) (- (sqrt 5.0) 1.0)) 3.0)))
double code(double x, double y) {
return 2.0 / fma(1.5, fma(cos(y), (3.0 - sqrt(5.0)), (sqrt(5.0) - 1.0)), 3.0);
}
function code(x, y) return Float64(2.0 / fma(1.5, fma(cos(y), Float64(3.0 - sqrt(5.0)), Float64(sqrt(5.0) - 1.0)), 3.0)) end
code[x_, y_] := N[(2.0 / N[(1.5 * N[(N[Cos[y], $MachinePrecision] * N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos y, 3 - \sqrt{5}, \sqrt{5} - 1\right), 3\right)}
\end{array}
Initial program 99.2%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.3%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites55.9%
Taylor expanded in x around 0
Applied rewrites44.7%
Taylor expanded in x around 0
Applied rewrites42.1%
(FPCore (x y) :precision binary64 (/ 2.0 (fma 1.5 (fma (cos x) (- (sqrt 5.0) 1.0) (- 3.0 (sqrt 5.0))) 3.0)))
double code(double x, double y) {
return 2.0 / fma(1.5, fma(cos(x), (sqrt(5.0) - 1.0), (3.0 - sqrt(5.0))), 3.0);
}
function code(x, y) return Float64(2.0 / fma(1.5, fma(cos(x), Float64(sqrt(5.0) - 1.0), Float64(3.0 - sqrt(5.0))), 3.0)) end
code[x_, y_] := N[(2.0 / N[(1.5 * N[(N[Cos[x], $MachinePrecision] * N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] + N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\mathsf{fma}\left(1.5, \mathsf{fma}\left(\cos x, \sqrt{5} - 1, 3 - \sqrt{5}\right), 3\right)}
\end{array}
Initial program 99.2%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
distribute-lft-outN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.3%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites55.9%
Taylor expanded in x around 0
Applied rewrites44.7%
Taylor expanded in y around 0
Applied rewrites42.0%
herbie shell --seed 2024324
(FPCore (x y)
:name "Diagrams.TwoD.Path.Metafont.Internal:hobbyF from diagrams-contrib-1.3.0.5"
:precision binary64
(/ (+ 2.0 (* (* (* (sqrt 2.0) (- (sin x) (/ (sin y) 16.0))) (- (sin y) (/ (sin x) 16.0))) (- (cos x) (cos y)))) (* 3.0 (+ (+ 1.0 (* (/ (- (sqrt 5.0) 1.0) 2.0) (cos x))) (* (/ (- 3.0 (sqrt 5.0)) 2.0) (cos y))))))