
(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 26 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
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ (sin x) (* (sin y) -0.0625)) (- (cos x) (cos y))))
2.0)
(+
3.0
(+
(* (cos y) (* 1.5 (/ 4.0 (+ 3.0 (sqrt 5.0)))))
(* (cos x) (pow (cbrt (* 1.5 (+ (sqrt 5.0) -1.0))) 3.0))))))
double code(double x, double y) {
return fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((sin(x) + (sin(y) * -0.0625)) * (cos(x) - cos(y)))), 2.0) / (3.0 + ((cos(y) * (1.5 * (4.0 / (3.0 + sqrt(5.0))))) + (cos(x) * pow(cbrt((1.5 * (sqrt(5.0) + -1.0))), 3.0))));
}
function code(x, y) return Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(sin(x) + Float64(sin(y) * -0.0625)) * Float64(cos(x) - cos(y)))), 2.0) / Float64(3.0 + Float64(Float64(cos(y) * Float64(1.5 * Float64(4.0 / Float64(3.0 + sqrt(5.0))))) + Float64(cos(x) * (cbrt(Float64(1.5 * Float64(sqrt(5.0) + -1.0))) ^ 3.0))))) end
code[x_, y_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[x], $MachinePrecision] + N[(N[Sin[y], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(N[(N[Cos[y], $MachinePrecision] * N[(1.5 * N[(4.0 / N[(3.0 + N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[x], $MachinePrecision] * N[Power[N[Power[N[(1.5 * N[(N[Sqrt[5.0], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(\sin x + \sin y \cdot -0.0625\right) \cdot \left(\cos x - \cos y\right)\right), 2\right)}{3 + \left(\cos y \cdot \left(1.5 \cdot \frac{4}{3 + \sqrt{5}}\right) + \cos x \cdot {\left(\sqrt[3]{1.5 \cdot \left(\sqrt{5} + -1\right)}\right)}^{3}\right)}
\end{array}
Initial program 99.3%
Simplified99.3%
fma-undefine99.3%
*-commutative99.3%
associate-*l*99.4%
Applied egg-rr99.4%
flip--99.1%
metadata-eval99.1%
pow1/299.1%
pow1/299.1%
pow-prod-up99.3%
metadata-eval99.3%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr99.3%
+-commutative99.3%
Simplified99.3%
add-cube-cbrt99.3%
pow399.5%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (x y)
:precision binary64
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ (sin x) (* (sin y) -0.0625)) (- (cos x) (cos y))))
2.0)
(+
3.0
(fma
(* 1.5 (+ (sqrt 5.0) -1.0))
(cos x)
(* (cos y) (* 1.5 (- 3.0 (sqrt 5.0))))))))
double code(double x, double y) {
return fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((sin(x) + (sin(y) * -0.0625)) * (cos(x) - cos(y)))), 2.0) / (3.0 + fma((1.5 * (sqrt(5.0) + -1.0)), cos(x), (cos(y) * (1.5 * (3.0 - sqrt(5.0))))));
}
function code(x, y) return Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(sin(x) + Float64(sin(y) * -0.0625)) * Float64(cos(x) - cos(y)))), 2.0) / Float64(3.0 + fma(Float64(1.5 * Float64(sqrt(5.0) + -1.0)), cos(x), Float64(cos(y) * Float64(1.5 * Float64(3.0 - sqrt(5.0))))))) end
code[x_, y_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[x], $MachinePrecision] + N[(N[Sin[y], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(N[(1.5 * N[(N[Sqrt[5.0], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] * N[Cos[x], $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(1.5 * N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(\sin x + \sin y \cdot -0.0625\right) \cdot \left(\cos x - \cos y\right)\right), 2\right)}{3 + \mathsf{fma}\left(1.5 \cdot \left(\sqrt{5} + -1\right), \cos x, \cos y \cdot \left(1.5 \cdot \left(3 - \sqrt{5}\right)\right)\right)}
\end{array}
Initial program 99.3%
Simplified99.3%
fma-undefine99.3%
*-commutative99.3%
associate-*l*99.4%
Applied egg-rr99.4%
+-commutative99.4%
*-commutative99.4%
fma-define99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (x y)
:precision binary64
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ (sin x) (* (sin y) -0.0625)) (- (cos x) (cos y))))
2.0)
(+
3.0
(fma
(* 1.5 (+ (sqrt 5.0) -1.0))
(cos x)
(* (cos y) (/ 6.0 (+ 3.0 (sqrt 5.0))))))))
double code(double x, double y) {
return fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((sin(x) + (sin(y) * -0.0625)) * (cos(x) - cos(y)))), 2.0) / (3.0 + fma((1.5 * (sqrt(5.0) + -1.0)), cos(x), (cos(y) * (6.0 / (3.0 + sqrt(5.0))))));
}
function code(x, y) return Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(sin(x) + Float64(sin(y) * -0.0625)) * Float64(cos(x) - cos(y)))), 2.0) / Float64(3.0 + fma(Float64(1.5 * Float64(sqrt(5.0) + -1.0)), cos(x), Float64(cos(y) * Float64(6.0 / Float64(3.0 + sqrt(5.0))))))) end
code[x_, y_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[x], $MachinePrecision] + N[(N[Sin[y], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(N[(1.5 * N[(N[Sqrt[5.0], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] * N[Cos[x], $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(6.0 / N[(3.0 + N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(\sin x + \sin y \cdot -0.0625\right) \cdot \left(\cos x - \cos y\right)\right), 2\right)}{3 + \mathsf{fma}\left(1.5 \cdot \left(\sqrt{5} + -1\right), \cos x, \cos y \cdot \frac{6}{3 + \sqrt{5}}\right)}
\end{array}
Initial program 99.3%
Simplified99.3%
fma-undefine99.3%
*-commutative99.3%
associate-*l*99.4%
Applied egg-rr99.4%
flip--99.1%
metadata-eval99.1%
pow1/299.1%
pow1/299.1%
pow-prod-up99.3%
metadata-eval99.3%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr99.3%
+-commutative99.3%
Simplified99.3%
+-commutative99.3%
*-commutative99.3%
fma-undefine99.4%
associate-*r/99.4%
metadata-eval99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (x y)
:precision binary64
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ (sin x) (* (sin y) -0.0625)) (- (cos x) (cos y))))
2.0)
(+
3.0
(+
(* 1.5 (* (cos x) (+ (sqrt 5.0) -1.0)))
(* 6.0 (/ (cos y) (+ 3.0 (sqrt 5.0))))))))
double code(double x, double y) {
return fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((sin(x) + (sin(y) * -0.0625)) * (cos(x) - cos(y)))), 2.0) / (3.0 + ((1.5 * (cos(x) * (sqrt(5.0) + -1.0))) + (6.0 * (cos(y) / (3.0 + sqrt(5.0))))));
}
function code(x, y) return Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(sin(x) + Float64(sin(y) * -0.0625)) * Float64(cos(x) - cos(y)))), 2.0) / Float64(3.0 + Float64(Float64(1.5 * Float64(cos(x) * Float64(sqrt(5.0) + -1.0))) + Float64(6.0 * Float64(cos(y) / Float64(3.0 + sqrt(5.0))))))) end
code[x_, y_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[x], $MachinePrecision] + N[(N[Sin[y], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(N[(1.5 * N[(N[Cos[x], $MachinePrecision] * N[(N[Sqrt[5.0], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(6.0 * N[(N[Cos[y], $MachinePrecision] / N[(3.0 + N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(\sin x + \sin y \cdot -0.0625\right) \cdot \left(\cos x - \cos y\right)\right), 2\right)}{3 + \left(1.5 \cdot \left(\cos x \cdot \left(\sqrt{5} + -1\right)\right) + 6 \cdot \frac{\cos y}{3 + \sqrt{5}}\right)}
\end{array}
Initial program 99.3%
Simplified99.3%
flip--99.1%
metadata-eval99.1%
pow1/299.1%
pow1/299.1%
pow-prod-up99.3%
metadata-eval99.3%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in y around inf 99.4%
Final simplification99.4%
(FPCore (x y)
:precision binary64
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ (sin x) (* (sin y) -0.0625)) (- (cos x) (cos y))))
2.0)
(+
3.0
(+
(* (cos y) (* 1.5 (- 3.0 (sqrt 5.0))))
(* (cos x) (* 1.5 (+ (sqrt 5.0) -1.0)))))))
double code(double x, double y) {
return fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((sin(x) + (sin(y) * -0.0625)) * (cos(x) - cos(y)))), 2.0) / (3.0 + ((cos(y) * (1.5 * (3.0 - sqrt(5.0)))) + (cos(x) * (1.5 * (sqrt(5.0) + -1.0)))));
}
function code(x, y) return Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(sin(x) + Float64(sin(y) * -0.0625)) * Float64(cos(x) - cos(y)))), 2.0) / Float64(3.0 + Float64(Float64(cos(y) * Float64(1.5 * Float64(3.0 - sqrt(5.0)))) + Float64(cos(x) * Float64(1.5 * Float64(sqrt(5.0) + -1.0)))))) end
code[x_, y_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[x], $MachinePrecision] + N[(N[Sin[y], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(N[(N[Cos[y], $MachinePrecision] * N[(1.5 * N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[x], $MachinePrecision] * N[(1.5 * N[(N[Sqrt[5.0], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(\sin x + \sin y \cdot -0.0625\right) \cdot \left(\cos x - \cos y\right)\right), 2\right)}{3 + \left(\cos y \cdot \left(1.5 \cdot \left(3 - \sqrt{5}\right)\right) + \cos x \cdot \left(1.5 \cdot \left(\sqrt{5} + -1\right)\right)\right)}
\end{array}
Initial program 99.3%
Simplified99.3%
fma-undefine99.3%
*-commutative99.3%
associate-*l*99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sqrt 5.0) 2.0)))
(/
(+
2.0
(*
(- (cos x) (cos y))
(*
(sqrt 2.0)
(* (- (sin x) (/ (sin y) 16.0)) (- (sin y) (/ (sin x) 16.0))))))
(* 3.0 (+ 1.0 (+ (* (cos x) (- t_0 0.5)) (* (cos y) (- 1.5 t_0))))))))
double code(double x, double y) {
double t_0 = sqrt(5.0) / 2.0;
return (2.0 + ((cos(x) - cos(y)) * (sqrt(2.0) * ((sin(x) - (sin(y) / 16.0)) * (sin(y) - (sin(x) / 16.0)))))) / (3.0 * (1.0 + ((cos(x) * (t_0 - 0.5)) + (cos(y) * (1.5 - t_0)))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = sqrt(5.0d0) / 2.0d0
code = (2.0d0 + ((cos(x) - cos(y)) * (sqrt(2.0d0) * ((sin(x) - (sin(y) / 16.0d0)) * (sin(y) - (sin(x) / 16.0d0)))))) / (3.0d0 * (1.0d0 + ((cos(x) * (t_0 - 0.5d0)) + (cos(y) * (1.5d0 - t_0)))))
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt(5.0) / 2.0;
return (2.0 + ((Math.cos(x) - Math.cos(y)) * (Math.sqrt(2.0) * ((Math.sin(x) - (Math.sin(y) / 16.0)) * (Math.sin(y) - (Math.sin(x) / 16.0)))))) / (3.0 * (1.0 + ((Math.cos(x) * (t_0 - 0.5)) + (Math.cos(y) * (1.5 - t_0)))));
}
def code(x, y): t_0 = math.sqrt(5.0) / 2.0 return (2.0 + ((math.cos(x) - math.cos(y)) * (math.sqrt(2.0) * ((math.sin(x) - (math.sin(y) / 16.0)) * (math.sin(y) - (math.sin(x) / 16.0)))))) / (3.0 * (1.0 + ((math.cos(x) * (t_0 - 0.5)) + (math.cos(y) * (1.5 - t_0)))))
function code(x, y) t_0 = Float64(sqrt(5.0) / 2.0) return Float64(Float64(2.0 + Float64(Float64(cos(x) - cos(y)) * Float64(sqrt(2.0) * Float64(Float64(sin(x) - Float64(sin(y) / 16.0)) * Float64(sin(y) - Float64(sin(x) / 16.0)))))) / Float64(3.0 * Float64(1.0 + Float64(Float64(cos(x) * Float64(t_0 - 0.5)) + Float64(cos(y) * Float64(1.5 - t_0)))))) end
function tmp = code(x, y) t_0 = sqrt(5.0) / 2.0; tmp = (2.0 + ((cos(x) - cos(y)) * (sqrt(2.0) * ((sin(x) - (sin(y) / 16.0)) * (sin(y) - (sin(x) / 16.0)))))) / (3.0 * (1.0 + ((cos(x) * (t_0 - 0.5)) + (cos(y) * (1.5 - t_0))))); end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] / 2.0), $MachinePrecision]}, N[(N[(2.0 + N[(N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[x], $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(1.0 + N[(N[(N[Cos[x], $MachinePrecision] * N[(t$95$0 - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(1.5 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{5}}{2}\\
\frac{2 + \left(\cos x - \cos y\right) \cdot \left(\sqrt{2} \cdot \left(\left(\sin x - \frac{\sin y}{16}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right)\right)}{3 \cdot \left(1 + \left(\cos x \cdot \left(t\_0 - 0.5\right) + \cos y \cdot \left(1.5 - t\_0\right)\right)\right)}
\end{array}
\end{array}
Initial program 99.3%
associate-*l*99.4%
distribute-rgt-in99.4%
cos-neg99.4%
distribute-rgt-in99.4%
associate-+l+99.3%
Simplified99.3%
Final simplification99.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (sin y) (/ (sin x) 16.0)))
(t_1
(*
3.0
(+
(+ 1.0 (* (cos x) (/ (+ (sqrt 5.0) -1.0) 2.0)))
(* (cos y) (/ (- 3.0 (sqrt 5.0)) 2.0)))))
(t_2 (- (cos x) (cos y))))
(if (or (<= x -0.3) (not (<= x 0.038)))
(/ (+ 2.0 (* t_2 (* t_0 (* (sqrt 2.0) (sin x))))) t_1)
(/
(+ 2.0 (* t_2 (* t_0 (* (sqrt 2.0) (+ x (* (sin y) -0.0625))))))
t_1))))
double code(double x, double y) {
double t_0 = sin(y) - (sin(x) / 16.0);
double t_1 = 3.0 * ((1.0 + (cos(x) * ((sqrt(5.0) + -1.0) / 2.0))) + (cos(y) * ((3.0 - sqrt(5.0)) / 2.0)));
double t_2 = cos(x) - cos(y);
double tmp;
if ((x <= -0.3) || !(x <= 0.038)) {
tmp = (2.0 + (t_2 * (t_0 * (sqrt(2.0) * sin(x))))) / t_1;
} else {
tmp = (2.0 + (t_2 * (t_0 * (sqrt(2.0) * (x + (sin(y) * -0.0625)))))) / t_1;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = sin(y) - (sin(x) / 16.0d0)
t_1 = 3.0d0 * ((1.0d0 + (cos(x) * ((sqrt(5.0d0) + (-1.0d0)) / 2.0d0))) + (cos(y) * ((3.0d0 - sqrt(5.0d0)) / 2.0d0)))
t_2 = cos(x) - cos(y)
if ((x <= (-0.3d0)) .or. (.not. (x <= 0.038d0))) then
tmp = (2.0d0 + (t_2 * (t_0 * (sqrt(2.0d0) * sin(x))))) / t_1
else
tmp = (2.0d0 + (t_2 * (t_0 * (sqrt(2.0d0) * (x + (sin(y) * (-0.0625d0))))))) / t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sin(y) - (Math.sin(x) / 16.0);
double t_1 = 3.0 * ((1.0 + (Math.cos(x) * ((Math.sqrt(5.0) + -1.0) / 2.0))) + (Math.cos(y) * ((3.0 - Math.sqrt(5.0)) / 2.0)));
double t_2 = Math.cos(x) - Math.cos(y);
double tmp;
if ((x <= -0.3) || !(x <= 0.038)) {
tmp = (2.0 + (t_2 * (t_0 * (Math.sqrt(2.0) * Math.sin(x))))) / t_1;
} else {
tmp = (2.0 + (t_2 * (t_0 * (Math.sqrt(2.0) * (x + (Math.sin(y) * -0.0625)))))) / t_1;
}
return tmp;
}
def code(x, y): t_0 = math.sin(y) - (math.sin(x) / 16.0) t_1 = 3.0 * ((1.0 + (math.cos(x) * ((math.sqrt(5.0) + -1.0) / 2.0))) + (math.cos(y) * ((3.0 - math.sqrt(5.0)) / 2.0))) t_2 = math.cos(x) - math.cos(y) tmp = 0 if (x <= -0.3) or not (x <= 0.038): tmp = (2.0 + (t_2 * (t_0 * (math.sqrt(2.0) * math.sin(x))))) / t_1 else: tmp = (2.0 + (t_2 * (t_0 * (math.sqrt(2.0) * (x + (math.sin(y) * -0.0625)))))) / t_1 return tmp
function code(x, y) t_0 = Float64(sin(y) - Float64(sin(x) / 16.0)) t_1 = Float64(3.0 * Float64(Float64(1.0 + Float64(cos(x) * Float64(Float64(sqrt(5.0) + -1.0) / 2.0))) + Float64(cos(y) * Float64(Float64(3.0 - sqrt(5.0)) / 2.0)))) t_2 = Float64(cos(x) - cos(y)) tmp = 0.0 if ((x <= -0.3) || !(x <= 0.038)) tmp = Float64(Float64(2.0 + Float64(t_2 * Float64(t_0 * Float64(sqrt(2.0) * sin(x))))) / t_1); else tmp = Float64(Float64(2.0 + Float64(t_2 * Float64(t_0 * Float64(sqrt(2.0) * Float64(x + Float64(sin(y) * -0.0625)))))) / t_1); end return tmp end
function tmp_2 = code(x, y) t_0 = sin(y) - (sin(x) / 16.0); t_1 = 3.0 * ((1.0 + (cos(x) * ((sqrt(5.0) + -1.0) / 2.0))) + (cos(y) * ((3.0 - sqrt(5.0)) / 2.0))); t_2 = cos(x) - cos(y); tmp = 0.0; if ((x <= -0.3) || ~((x <= 0.038))) tmp = (2.0 + (t_2 * (t_0 * (sqrt(2.0) * sin(x))))) / t_1; else tmp = (2.0 + (t_2 * (t_0 * (sqrt(2.0) * (x + (sin(y) * -0.0625)))))) / t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(N[(1.0 + N[(N[Cos[x], $MachinePrecision] * N[(N[(N[Sqrt[5.0], $MachinePrecision] + -1.0), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -0.3], N[Not[LessEqual[x, 0.038]], $MachinePrecision]], N[(N[(2.0 + N[(t$95$2 * N[(t$95$0 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(2.0 + N[(t$95$2 * N[(t$95$0 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(x + N[(N[Sin[y], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin y - \frac{\sin x}{16}\\
t_1 := 3 \cdot \left(\left(1 + \cos x \cdot \frac{\sqrt{5} + -1}{2}\right) + \cos y \cdot \frac{3 - \sqrt{5}}{2}\right)\\
t_2 := \cos x - \cos y\\
\mathbf{if}\;x \leq -0.3 \lor \neg \left(x \leq 0.038\right):\\
\;\;\;\;\frac{2 + t\_2 \cdot \left(t\_0 \cdot \left(\sqrt{2} \cdot \sin x\right)\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + t\_2 \cdot \left(t\_0 \cdot \left(\sqrt{2} \cdot \left(x + \sin y \cdot -0.0625\right)\right)\right)}{t\_1}\\
\end{array}
\end{array}
if x < -0.299999999999999989 or 0.0379999999999999991 < x Initial program 99.0%
Taylor expanded in y around 0 62.9%
*-commutative62.9%
Simplified62.9%
if -0.299999999999999989 < x < 0.0379999999999999991Initial program 99.8%
Taylor expanded in x around 0 99.0%
+-commutative99.0%
associate-*r*99.0%
distribute-rgt-out99.0%
Simplified99.0%
Final simplification79.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (sqrt 5.0) -1.0)) (t_1 (- 3.0 (sqrt 5.0))))
(if (or (<= x -0.0032) (not (<= x 8.4e-5)))
(/
(+
2.0
(*
(- (cos x) (cos y))
(* (- (sin y) (/ (sin x) 16.0)) (* (sqrt 2.0) (sin x)))))
(* 3.0 (+ (+ 1.0 (* (cos x) (/ t_0 2.0))) (* (cos y) (/ t_1 2.0)))))
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ (sin x) (* (sin y) -0.0625)) (- 1.0 (cos y))))
2.0)
(+ 3.0 (+ (* 1.5 t_0) (* 1.5 (* (cos y) t_1))))))))
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.0032) || !(x <= 8.4e-5)) {
tmp = (2.0 + ((cos(x) - cos(y)) * ((sin(y) - (sin(x) / 16.0)) * (sqrt(2.0) * sin(x))))) / (3.0 * ((1.0 + (cos(x) * (t_0 / 2.0))) + (cos(y) * (t_1 / 2.0))));
} else {
tmp = fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((sin(x) + (sin(y) * -0.0625)) * (1.0 - cos(y)))), 2.0) / (3.0 + ((1.5 * t_0) + (1.5 * (cos(y) * t_1))));
}
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.0032) || !(x <= 8.4e-5)) tmp = Float64(Float64(2.0 + Float64(Float64(cos(x) - cos(y)) * Float64(Float64(sin(y) - Float64(sin(x) / 16.0)) * Float64(sqrt(2.0) * sin(x))))) / Float64(3.0 * Float64(Float64(1.0 + Float64(cos(x) * Float64(t_0 / 2.0))) + Float64(cos(y) * Float64(t_1 / 2.0))))); else tmp = Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(sin(x) + Float64(sin(y) * -0.0625)) * Float64(1.0 - cos(y)))), 2.0) / Float64(3.0 + Float64(Float64(1.5 * t_0) + Float64(1.5 * Float64(cos(y) * t_1))))); 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.0032], N[Not[LessEqual[x, 8.4e-5]], $MachinePrecision]], N[(N[(2.0 + N[(N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(N[(1.0 + N[(N[Cos[x], $MachinePrecision] * N[(t$95$0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(t$95$1 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[x], $MachinePrecision] + N[(N[Sin[y], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(N[(1.5 * t$95$0), $MachinePrecision] + N[(1.5 * N[(N[Cos[y], $MachinePrecision] * t$95$1), $MachinePrecision]), $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.0032 \lor \neg \left(x \leq 8.4 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{2 + \left(\cos x - \cos y\right) \cdot \left(\left(\sin y - \frac{\sin x}{16}\right) \cdot \left(\sqrt{2} \cdot \sin x\right)\right)}{3 \cdot \left(\left(1 + \cos x \cdot \frac{t\_0}{2}\right) + \cos y \cdot \frac{t\_1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(\sin x + \sin y \cdot -0.0625\right) \cdot \left(1 - \cos y\right)\right), 2\right)}{3 + \left(1.5 \cdot t\_0 + 1.5 \cdot \left(\cos y \cdot t\_1\right)\right)}\\
\end{array}
\end{array}
if x < -0.00320000000000000015 or 8.39999999999999954e-5 < x Initial program 99.0%
Taylor expanded in y around 0 62.7%
*-commutative62.7%
Simplified62.7%
if -0.00320000000000000015 < x < 8.39999999999999954e-5Initial program 99.8%
Simplified99.8%
fma-undefine99.8%
*-commutative99.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around 0 99.2%
Final simplification79.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (sqrt 5.0) -1.0)) (t_1 (- 3.0 (sqrt 5.0))))
(if (or (<= x -0.0042) (not (<= x 0.00145)))
(/
(+
2.0
(*
(- (cos x) (cos y))
(* (- (sin y) (/ (sin x) 16.0)) (* (sqrt 2.0) (sin x)))))
(* 3.0 (+ (+ 1.0 (* (cos x) (/ t_0 2.0))) (* (cos y) (/ t_1 2.0)))))
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ x (* (sin y) -0.0625)) (- 1.0 (cos y))))
2.0)
(+ 3.0 (+ (* (cos y) (* 1.5 t_1)) (* (cos x) (* 1.5 t_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.0042) || !(x <= 0.00145)) {
tmp = (2.0 + ((cos(x) - cos(y)) * ((sin(y) - (sin(x) / 16.0)) * (sqrt(2.0) * sin(x))))) / (3.0 * ((1.0 + (cos(x) * (t_0 / 2.0))) + (cos(y) * (t_1 / 2.0))));
} else {
tmp = fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((x + (sin(y) * -0.0625)) * (1.0 - cos(y)))), 2.0) / (3.0 + ((cos(y) * (1.5 * t_1)) + (cos(x) * (1.5 * t_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.0042) || !(x <= 0.00145)) tmp = Float64(Float64(2.0 + Float64(Float64(cos(x) - cos(y)) * Float64(Float64(sin(y) - Float64(sin(x) / 16.0)) * Float64(sqrt(2.0) * sin(x))))) / Float64(3.0 * Float64(Float64(1.0 + Float64(cos(x) * Float64(t_0 / 2.0))) + Float64(cos(y) * Float64(t_1 / 2.0))))); else tmp = Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(x + Float64(sin(y) * -0.0625)) * Float64(1.0 - cos(y)))), 2.0) / Float64(3.0 + Float64(Float64(cos(y) * Float64(1.5 * t_1)) + Float64(cos(x) * Float64(1.5 * t_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.0042], N[Not[LessEqual[x, 0.00145]], $MachinePrecision]], N[(N[(2.0 + N[(N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(N[(1.0 + N[(N[Cos[x], $MachinePrecision] * N[(t$95$0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(t$95$1 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(x + N[(N[Sin[y], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(N[(N[Cos[y], $MachinePrecision] * N[(1.5 * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[x], $MachinePrecision] * N[(1.5 * t$95$0), $MachinePrecision]), $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.0042 \lor \neg \left(x \leq 0.00145\right):\\
\;\;\;\;\frac{2 + \left(\cos x - \cos y\right) \cdot \left(\left(\sin y - \frac{\sin x}{16}\right) \cdot \left(\sqrt{2} \cdot \sin x\right)\right)}{3 \cdot \left(\left(1 + \cos x \cdot \frac{t\_0}{2}\right) + \cos y \cdot \frac{t\_1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(x + \sin y \cdot -0.0625\right) \cdot \left(1 - \cos y\right)\right), 2\right)}{3 + \left(\cos y \cdot \left(1.5 \cdot t\_1\right) + \cos x \cdot \left(1.5 \cdot t\_0\right)\right)}\\
\end{array}
\end{array}
if x < -0.00419999999999999974 or 0.00145 < x Initial program 99.0%
Taylor expanded in y around 0 62.7%
*-commutative62.7%
Simplified62.7%
if -0.00419999999999999974 < x < 0.00145Initial program 99.8%
Simplified99.8%
fma-undefine99.8%
*-commutative99.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.4%
associate-*r*99.4%
*-commutative99.4%
distribute-rgt-out99.4%
*-commutative99.4%
Simplified99.4%
Final simplification79.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 1.5 (+ (sqrt 5.0) -1.0)))
(t_1 (* (cos x) t_0))
(t_2 (- 3.0 (sqrt 5.0)))
(t_3 (+ (sin y) (* (sin x) -0.0625)))
(t_4 (fma (sqrt 2.0) (* t_3 (* (sin x) (+ (cos x) -1.0))) 2.0)))
(if (<= x -0.0032)
(/ t_4 (+ 3.0 (+ (* (cos y) (* 1.5 (/ 4.0 (+ 3.0 (sqrt 5.0))))) t_1)))
(if (<= x 0.000156)
(/
(fma
(sqrt 2.0)
(* t_3 (* (+ (sin x) (* (sin y) -0.0625)) (- 1.0 (cos y))))
2.0)
(+ 3.0 (+ t_0 (* 1.5 (* (cos y) t_2)))))
(/ t_4 (+ 3.0 (+ (* (cos y) (* 1.5 t_2)) t_1)))))))
double code(double x, double y) {
double t_0 = 1.5 * (sqrt(5.0) + -1.0);
double t_1 = cos(x) * t_0;
double t_2 = 3.0 - sqrt(5.0);
double t_3 = sin(y) + (sin(x) * -0.0625);
double t_4 = fma(sqrt(2.0), (t_3 * (sin(x) * (cos(x) + -1.0))), 2.0);
double tmp;
if (x <= -0.0032) {
tmp = t_4 / (3.0 + ((cos(y) * (1.5 * (4.0 / (3.0 + sqrt(5.0))))) + t_1));
} else if (x <= 0.000156) {
tmp = fma(sqrt(2.0), (t_3 * ((sin(x) + (sin(y) * -0.0625)) * (1.0 - cos(y)))), 2.0) / (3.0 + (t_0 + (1.5 * (cos(y) * t_2))));
} else {
tmp = t_4 / (3.0 + ((cos(y) * (1.5 * t_2)) + t_1));
}
return tmp;
}
function code(x, y) t_0 = Float64(1.5 * Float64(sqrt(5.0) + -1.0)) t_1 = Float64(cos(x) * t_0) t_2 = Float64(3.0 - sqrt(5.0)) t_3 = Float64(sin(y) + Float64(sin(x) * -0.0625)) t_4 = fma(sqrt(2.0), Float64(t_3 * Float64(sin(x) * Float64(cos(x) + -1.0))), 2.0) tmp = 0.0 if (x <= -0.0032) tmp = Float64(t_4 / Float64(3.0 + Float64(Float64(cos(y) * Float64(1.5 * Float64(4.0 / Float64(3.0 + sqrt(5.0))))) + t_1))); elseif (x <= 0.000156) tmp = Float64(fma(sqrt(2.0), Float64(t_3 * Float64(Float64(sin(x) + Float64(sin(y) * -0.0625)) * Float64(1.0 - cos(y)))), 2.0) / Float64(3.0 + Float64(t_0 + Float64(1.5 * Float64(cos(y) * t_2))))); else tmp = Float64(t_4 / Float64(3.0 + Float64(Float64(cos(y) * Float64(1.5 * t_2)) + t_1))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(1.5 * N[(N[Sqrt[5.0], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$3 * N[(N[Sin[x], $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]}, If[LessEqual[x, -0.0032], N[(t$95$4 / N[(3.0 + N[(N[(N[Cos[y], $MachinePrecision] * N[(1.5 * N[(4.0 / N[(3.0 + N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.000156], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$3 * N[(N[(N[Sin[x], $MachinePrecision] + N[(N[Sin[y], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(t$95$0 + N[(1.5 * N[(N[Cos[y], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$4 / N[(3.0 + N[(N[(N[Cos[y], $MachinePrecision] * N[(1.5 * t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1.5 \cdot \left(\sqrt{5} + -1\right)\\
t_1 := \cos x \cdot t\_0\\
t_2 := 3 - \sqrt{5}\\
t_3 := \sin y + \sin x \cdot -0.0625\\
t_4 := \mathsf{fma}\left(\sqrt{2}, t\_3 \cdot \left(\sin x \cdot \left(\cos x + -1\right)\right), 2\right)\\
\mathbf{if}\;x \leq -0.0032:\\
\;\;\;\;\frac{t\_4}{3 + \left(\cos y \cdot \left(1.5 \cdot \frac{4}{3 + \sqrt{5}}\right) + t\_1\right)}\\
\mathbf{elif}\;x \leq 0.000156:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, t\_3 \cdot \left(\left(\sin x + \sin y \cdot -0.0625\right) \cdot \left(1 - \cos y\right)\right), 2\right)}{3 + \left(t\_0 + 1.5 \cdot \left(\cos y \cdot t\_2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_4}{3 + \left(\cos y \cdot \left(1.5 \cdot t\_2\right) + t\_1\right)}\\
\end{array}
\end{array}
if x < -0.00320000000000000015Initial program 99.0%
Simplified99.0%
fma-undefine98.9%
*-commutative98.9%
associate-*l*99.2%
Applied egg-rr99.2%
flip--98.6%
metadata-eval98.6%
pow1/298.6%
pow1/298.6%
pow-prod-up99.0%
metadata-eval99.0%
metadata-eval99.0%
metadata-eval99.0%
Applied egg-rr99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in y around 0 62.2%
if -0.00320000000000000015 < x < 1.56e-4Initial program 99.8%
Simplified99.8%
fma-undefine99.8%
*-commutative99.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around 0 99.2%
if 1.56e-4 < x Initial program 99.0%
Simplified99.0%
fma-undefine98.9%
*-commutative98.9%
associate-*l*99.0%
Applied egg-rr99.0%
Taylor expanded in y around 0 57.1%
Final simplification77.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 3.0 (sqrt 5.0)))
(t_1 (+ (sqrt 5.0) -1.0))
(t_2 (+ (sin y) (* (sin x) -0.0625))))
(if (or (<= x -0.0032) (not (<= x 3.5e-5)))
(/
(fma (sqrt 2.0) (* t_2 (* (sin x) (+ (cos x) -1.0))) 2.0)
(+ 3.0 (+ (* (cos y) (* 1.5 t_0)) (* (cos x) (* 1.5 t_1)))))
(/
(fma
(sqrt 2.0)
(* t_2 (* (+ (sin x) (* (sin y) -0.0625)) (- 1.0 (cos y))))
2.0)
(+ 3.0 (* 1.5 (+ t_1 (* (cos y) t_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 = sin(y) + (sin(x) * -0.0625);
double tmp;
if ((x <= -0.0032) || !(x <= 3.5e-5)) {
tmp = fma(sqrt(2.0), (t_2 * (sin(x) * (cos(x) + -1.0))), 2.0) / (3.0 + ((cos(y) * (1.5 * t_0)) + (cos(x) * (1.5 * t_1))));
} else {
tmp = fma(sqrt(2.0), (t_2 * ((sin(x) + (sin(y) * -0.0625)) * (1.0 - cos(y)))), 2.0) / (3.0 + (1.5 * (t_1 + (cos(y) * t_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 = Float64(sin(y) + Float64(sin(x) * -0.0625)) tmp = 0.0 if ((x <= -0.0032) || !(x <= 3.5e-5)) tmp = Float64(fma(sqrt(2.0), Float64(t_2 * Float64(sin(x) * Float64(cos(x) + -1.0))), 2.0) / Float64(3.0 + Float64(Float64(cos(y) * Float64(1.5 * t_0)) + Float64(cos(x) * Float64(1.5 * t_1))))); else tmp = Float64(fma(sqrt(2.0), Float64(t_2 * Float64(Float64(sin(x) + Float64(sin(y) * -0.0625)) * Float64(1.0 - cos(y)))), 2.0) / Float64(3.0 + Float64(1.5 * Float64(t_1 + Float64(cos(y) * t_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[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -0.0032], N[Not[LessEqual[x, 3.5e-5]], $MachinePrecision]], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$2 * N[(N[Sin[x], $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(N[(N[Cos[y], $MachinePrecision] * N[(1.5 * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[x], $MachinePrecision] * N[(1.5 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$2 * N[(N[(N[Sin[x], $MachinePrecision] + N[(N[Sin[y], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(1.5 * N[(t$95$1 + N[(N[Cos[y], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - \sqrt{5}\\
t_1 := \sqrt{5} + -1\\
t_2 := \sin y + \sin x \cdot -0.0625\\
\mathbf{if}\;x \leq -0.0032 \lor \neg \left(x \leq 3.5 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, t\_2 \cdot \left(\sin x \cdot \left(\cos x + -1\right)\right), 2\right)}{3 + \left(\cos y \cdot \left(1.5 \cdot t\_0\right) + \cos x \cdot \left(1.5 \cdot t\_1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, t\_2 \cdot \left(\left(\sin x + \sin y \cdot -0.0625\right) \cdot \left(1 - \cos y\right)\right), 2\right)}{3 + 1.5 \cdot \left(t\_1 + \cos y \cdot t\_0\right)}\\
\end{array}
\end{array}
if x < -0.00320000000000000015 or 3.4999999999999997e-5 < x Initial program 99.0%
Simplified99.0%
fma-undefine98.9%
*-commutative98.9%
associate-*l*99.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 59.5%
if -0.00320000000000000015 < x < 3.4999999999999997e-5Initial program 99.8%
Simplified99.8%
fma-undefine99.8%
*-commutative99.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around 0 99.2%
distribute-lft-out99.2%
*-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification77.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (sin y) (* (sin x) -0.0625)))
(t_1 (fma (sqrt 2.0) (* t_0 (* (sin x) (+ (cos x) -1.0))) 2.0))
(t_2 (+ (sqrt 5.0) -1.0))
(t_3 (* (cos x) (* 1.5 t_2)))
(t_4 (- 3.0 (sqrt 5.0))))
(if (<= x -0.0032)
(/ t_1 (+ 3.0 (+ (* (cos y) (* 1.5 (/ 4.0 (+ 3.0 (sqrt 5.0))))) t_3)))
(if (<= x 8e-5)
(/
(fma
(sqrt 2.0)
(* t_0 (* (+ (sin x) (* (sin y) -0.0625)) (- 1.0 (cos y))))
2.0)
(+ 3.0 (* 1.5 (+ t_2 (* (cos y) t_4)))))
(/ t_1 (+ 3.0 (+ (* (cos y) (* 1.5 t_4)) t_3)))))))
double code(double x, double y) {
double t_0 = sin(y) + (sin(x) * -0.0625);
double t_1 = fma(sqrt(2.0), (t_0 * (sin(x) * (cos(x) + -1.0))), 2.0);
double t_2 = sqrt(5.0) + -1.0;
double t_3 = cos(x) * (1.5 * t_2);
double t_4 = 3.0 - sqrt(5.0);
double tmp;
if (x <= -0.0032) {
tmp = t_1 / (3.0 + ((cos(y) * (1.5 * (4.0 / (3.0 + sqrt(5.0))))) + t_3));
} else if (x <= 8e-5) {
tmp = fma(sqrt(2.0), (t_0 * ((sin(x) + (sin(y) * -0.0625)) * (1.0 - cos(y)))), 2.0) / (3.0 + (1.5 * (t_2 + (cos(y) * t_4))));
} else {
tmp = t_1 / (3.0 + ((cos(y) * (1.5 * t_4)) + t_3));
}
return tmp;
}
function code(x, y) t_0 = Float64(sin(y) + Float64(sin(x) * -0.0625)) t_1 = fma(sqrt(2.0), Float64(t_0 * Float64(sin(x) * Float64(cos(x) + -1.0))), 2.0) t_2 = Float64(sqrt(5.0) + -1.0) t_3 = Float64(cos(x) * Float64(1.5 * t_2)) t_4 = Float64(3.0 - sqrt(5.0)) tmp = 0.0 if (x <= -0.0032) tmp = Float64(t_1 / Float64(3.0 + Float64(Float64(cos(y) * Float64(1.5 * Float64(4.0 / Float64(3.0 + sqrt(5.0))))) + t_3))); elseif (x <= 8e-5) tmp = Float64(fma(sqrt(2.0), Float64(t_0 * Float64(Float64(sin(x) + Float64(sin(y) * -0.0625)) * Float64(1.0 - cos(y)))), 2.0) / Float64(3.0 + Float64(1.5 * Float64(t_2 + Float64(cos(y) * t_4))))); else tmp = Float64(t_1 / Float64(3.0 + Float64(Float64(cos(y) * Float64(1.5 * t_4)) + t_3))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$0 * N[(N[Sin[x], $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[5.0], $MachinePrecision] + -1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[Cos[x], $MachinePrecision] * N[(1.5 * t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.0032], N[(t$95$1 / N[(3.0 + N[(N[(N[Cos[y], $MachinePrecision] * N[(1.5 * N[(4.0 / N[(3.0 + N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-5], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$0 * N[(N[(N[Sin[x], $MachinePrecision] + N[(N[Sin[y], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(1.5 * N[(t$95$2 + N[(N[Cos[y], $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(3.0 + N[(N[(N[Cos[y], $MachinePrecision] * N[(1.5 * t$95$4), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin y + \sin x \cdot -0.0625\\
t_1 := \mathsf{fma}\left(\sqrt{2}, t\_0 \cdot \left(\sin x \cdot \left(\cos x + -1\right)\right), 2\right)\\
t_2 := \sqrt{5} + -1\\
t_3 := \cos x \cdot \left(1.5 \cdot t\_2\right)\\
t_4 := 3 - \sqrt{5}\\
\mathbf{if}\;x \leq -0.0032:\\
\;\;\;\;\frac{t\_1}{3 + \left(\cos y \cdot \left(1.5 \cdot \frac{4}{3 + \sqrt{5}}\right) + t\_3\right)}\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-5}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, t\_0 \cdot \left(\left(\sin x + \sin y \cdot -0.0625\right) \cdot \left(1 - \cos y\right)\right), 2\right)}{3 + 1.5 \cdot \left(t\_2 + \cos y \cdot t\_4\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{3 + \left(\cos y \cdot \left(1.5 \cdot t\_4\right) + t\_3\right)}\\
\end{array}
\end{array}
if x < -0.00320000000000000015Initial program 99.0%
Simplified99.0%
fma-undefine98.9%
*-commutative98.9%
associate-*l*99.2%
Applied egg-rr99.2%
flip--98.6%
metadata-eval98.6%
pow1/298.6%
pow1/298.6%
pow-prod-up99.0%
metadata-eval99.0%
metadata-eval99.0%
metadata-eval99.0%
Applied egg-rr99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in y around 0 62.2%
if -0.00320000000000000015 < x < 8.00000000000000065e-5Initial program 99.8%
Simplified99.8%
fma-undefine99.8%
*-commutative99.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around 0 99.2%
distribute-lft-out99.2%
*-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
if 8.00000000000000065e-5 < x Initial program 99.0%
Simplified99.0%
fma-undefine98.9%
*-commutative98.9%
associate-*l*99.0%
Applied egg-rr99.0%
Taylor expanded in y around 0 57.1%
Final simplification77.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sqrt 5.0) 2.0))
(t_1 (pow (sin y) 2.0))
(t_2 (+ (sqrt 5.0) -1.0)))
(if (<= y -0.00022)
(/
(+
2.0
(*
(* -0.0625 (* (sqrt 2.0) t_1))
(* (sin (/ (- x y) 2.0)) (* (sin (/ (+ y x) 2.0)) -2.0))))
(* 3.0 (+ 1.0 (+ (* (cos x) (- t_0 0.5)) (* (cos y) (- 1.5 t_0))))))
(if (<= y 0.000115)
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ (cos x) -1.0) (+ (sin x) (* y -0.0625))))
2.0)
(+ 3.0 (* 1.5 (+ (/ 4.0 (+ 3.0 (sqrt 5.0))) (* (cos x) t_2)))))
(/
(fma (sqrt 2.0) (* t_1 (* -0.0625 (- 1.0 (cos y)))) 2.0)
(+
3.0
(fma (* 1.5 t_2) (cos x) (* (cos y) (* 1.5 (- 3.0 (sqrt 5.0)))))))))))
double code(double x, double y) {
double t_0 = sqrt(5.0) / 2.0;
double t_1 = pow(sin(y), 2.0);
double t_2 = sqrt(5.0) + -1.0;
double tmp;
if (y <= -0.00022) {
tmp = (2.0 + ((-0.0625 * (sqrt(2.0) * t_1)) * (sin(((x - y) / 2.0)) * (sin(((y + x) / 2.0)) * -2.0)))) / (3.0 * (1.0 + ((cos(x) * (t_0 - 0.5)) + (cos(y) * (1.5 - t_0)))));
} else if (y <= 0.000115) {
tmp = fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((cos(x) + -1.0) * (sin(x) + (y * -0.0625)))), 2.0) / (3.0 + (1.5 * ((4.0 / (3.0 + sqrt(5.0))) + (cos(x) * t_2))));
} else {
tmp = fma(sqrt(2.0), (t_1 * (-0.0625 * (1.0 - cos(y)))), 2.0) / (3.0 + fma((1.5 * t_2), cos(x), (cos(y) * (1.5 * (3.0 - sqrt(5.0))))));
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) / 2.0) t_1 = sin(y) ^ 2.0 t_2 = Float64(sqrt(5.0) + -1.0) tmp = 0.0 if (y <= -0.00022) tmp = Float64(Float64(2.0 + Float64(Float64(-0.0625 * Float64(sqrt(2.0) * t_1)) * Float64(sin(Float64(Float64(x - y) / 2.0)) * Float64(sin(Float64(Float64(y + x) / 2.0)) * -2.0)))) / Float64(3.0 * Float64(1.0 + Float64(Float64(cos(x) * Float64(t_0 - 0.5)) + Float64(cos(y) * Float64(1.5 - t_0)))))); elseif (y <= 0.000115) tmp = Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(cos(x) + -1.0) * Float64(sin(x) + Float64(y * -0.0625)))), 2.0) / Float64(3.0 + Float64(1.5 * Float64(Float64(4.0 / Float64(3.0 + sqrt(5.0))) + Float64(cos(x) * t_2))))); else tmp = Float64(fma(sqrt(2.0), Float64(t_1 * Float64(-0.0625 * Float64(1.0 - cos(y)))), 2.0) / Float64(3.0 + fma(Float64(1.5 * t_2), cos(x), Float64(cos(y) * Float64(1.5 * Float64(3.0 - sqrt(5.0))))))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[5.0], $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[y, -0.00022], N[(N[(2.0 + N[(N[(-0.0625 * N[(N[Sqrt[2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(N[(x - y), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(N[(y + x), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(1.0 + N[(N[(N[Cos[x], $MachinePrecision] * N[(t$95$0 - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(1.5 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.000115], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] + -1.0), $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] + N[(y * -0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(1.5 * N[(N[(4.0 / N[(3.0 + N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[x], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$1 * N[(-0.0625 * N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(N[(1.5 * t$95$2), $MachinePrecision] * N[Cos[x], $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(1.5 * N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{5}}{2}\\
t_1 := {\sin y}^{2}\\
t_2 := \sqrt{5} + -1\\
\mathbf{if}\;y \leq -0.00022:\\
\;\;\;\;\frac{2 + \left(-0.0625 \cdot \left(\sqrt{2} \cdot t\_1\right)\right) \cdot \left(\sin \left(\frac{x - y}{2}\right) \cdot \left(\sin \left(\frac{y + x}{2}\right) \cdot -2\right)\right)}{3 \cdot \left(1 + \left(\cos x \cdot \left(t\_0 - 0.5\right) + \cos y \cdot \left(1.5 - t\_0\right)\right)\right)}\\
\mathbf{elif}\;y \leq 0.000115:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(\cos x + -1\right) \cdot \left(\sin x + y \cdot -0.0625\right)\right), 2\right)}{3 + 1.5 \cdot \left(\frac{4}{3 + \sqrt{5}} + \cos x \cdot t\_2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, t\_1 \cdot \left(-0.0625 \cdot \left(1 - \cos y\right)\right), 2\right)}{3 + \mathsf{fma}\left(1.5 \cdot t\_2, \cos x, \cos y \cdot \left(1.5 \cdot \left(3 - \sqrt{5}\right)\right)\right)}\\
\end{array}
\end{array}
if y < -2.20000000000000008e-4Initial program 99.2%
associate-*l*99.3%
distribute-rgt-in99.3%
cos-neg99.3%
distribute-rgt-in99.3%
associate-+l+99.2%
Simplified99.2%
Taylor expanded in x around 0 53.9%
diff-cos53.9%
Applied egg-rr53.9%
*-commutative53.9%
associate-*l*53.9%
+-commutative53.9%
Simplified53.9%
if -2.20000000000000008e-4 < y < 1.15e-4Initial program 99.5%
Simplified99.6%
Taylor expanded in y around 0 99.0%
distribute-lft-out99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around 0 99.0%
associate-*r*99.0%
distribute-rgt-out99.0%
sub-neg99.0%
metadata-eval99.0%
*-commutative99.0%
Simplified99.0%
flip--99.3%
metadata-eval99.3%
pow1/299.3%
pow1/299.3%
pow-prod-up99.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.0%
+-commutative99.6%
Simplified99.0%
if 1.15e-4 < y Initial program 99.0%
Simplified99.1%
fma-undefine99.0%
*-commutative99.0%
associate-*l*99.0%
Applied egg-rr99.0%
+-commutative99.0%
*-commutative99.0%
fma-define99.0%
Applied egg-rr99.0%
Taylor expanded in x around 0 54.4%
*-commutative54.4%
associate-*l*54.4%
*-commutative54.4%
Simplified54.4%
Final simplification77.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sqrt 5.0) 2.0)))
(if (or (<= y -0.00029) (not (<= y 0.00011)))
(/
(+
2.0
(*
(* -0.0625 (* (sqrt 2.0) (pow (sin y) 2.0)))
(* (sin (/ (- x y) 2.0)) (* (sin (/ (+ y x) 2.0)) -2.0))))
(* 3.0 (+ 1.0 (+ (* (cos x) (- t_0 0.5)) (* (cos y) (- 1.5 t_0))))))
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ (cos x) -1.0) (+ (sin x) (* y -0.0625))))
2.0)
(+
3.0
(*
1.5
(+ (/ 4.0 (+ 3.0 (sqrt 5.0))) (* (cos x) (+ (sqrt 5.0) -1.0)))))))))
double code(double x, double y) {
double t_0 = sqrt(5.0) / 2.0;
double tmp;
if ((y <= -0.00029) || !(y <= 0.00011)) {
tmp = (2.0 + ((-0.0625 * (sqrt(2.0) * pow(sin(y), 2.0))) * (sin(((x - y) / 2.0)) * (sin(((y + x) / 2.0)) * -2.0)))) / (3.0 * (1.0 + ((cos(x) * (t_0 - 0.5)) + (cos(y) * (1.5 - t_0)))));
} else {
tmp = fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((cos(x) + -1.0) * (sin(x) + (y * -0.0625)))), 2.0) / (3.0 + (1.5 * ((4.0 / (3.0 + sqrt(5.0))) + (cos(x) * (sqrt(5.0) + -1.0)))));
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) / 2.0) tmp = 0.0 if ((y <= -0.00029) || !(y <= 0.00011)) tmp = Float64(Float64(2.0 + Float64(Float64(-0.0625 * Float64(sqrt(2.0) * (sin(y) ^ 2.0))) * Float64(sin(Float64(Float64(x - y) / 2.0)) * Float64(sin(Float64(Float64(y + x) / 2.0)) * -2.0)))) / Float64(3.0 * Float64(1.0 + Float64(Float64(cos(x) * Float64(t_0 - 0.5)) + Float64(cos(y) * Float64(1.5 - t_0)))))); else tmp = Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(cos(x) + -1.0) * Float64(sin(x) + Float64(y * -0.0625)))), 2.0) / Float64(3.0 + Float64(1.5 * Float64(Float64(4.0 / Float64(3.0 + sqrt(5.0))) + Float64(cos(x) * Float64(sqrt(5.0) + -1.0)))))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] / 2.0), $MachinePrecision]}, If[Or[LessEqual[y, -0.00029], N[Not[LessEqual[y, 0.00011]], $MachinePrecision]], N[(N[(2.0 + N[(N[(-0.0625 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(N[(x - y), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(N[(y + x), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(1.0 + N[(N[(N[Cos[x], $MachinePrecision] * N[(t$95$0 - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(1.5 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] + -1.0), $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] + N[(y * -0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(1.5 * N[(N[(4.0 / N[(3.0 + N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[x], $MachinePrecision] * N[(N[Sqrt[5.0], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{5}}{2}\\
\mathbf{if}\;y \leq -0.00029 \lor \neg \left(y \leq 0.00011\right):\\
\;\;\;\;\frac{2 + \left(-0.0625 \cdot \left(\sqrt{2} \cdot {\sin y}^{2}\right)\right) \cdot \left(\sin \left(\frac{x - y}{2}\right) \cdot \left(\sin \left(\frac{y + x}{2}\right) \cdot -2\right)\right)}{3 \cdot \left(1 + \left(\cos x \cdot \left(t\_0 - 0.5\right) + \cos y \cdot \left(1.5 - t\_0\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(\cos x + -1\right) \cdot \left(\sin x + y \cdot -0.0625\right)\right), 2\right)}{3 + 1.5 \cdot \left(\frac{4}{3 + \sqrt{5}} + \cos x \cdot \left(\sqrt{5} + -1\right)\right)}\\
\end{array}
\end{array}
if y < -2.9e-4 or 1.10000000000000004e-4 < y Initial program 99.1%
associate-*l*99.2%
distribute-rgt-in99.2%
cos-neg99.2%
distribute-rgt-in99.2%
associate-+l+99.1%
Simplified99.1%
Taylor expanded in x around 0 54.0%
diff-cos54.1%
Applied egg-rr54.1%
*-commutative54.1%
associate-*l*54.1%
+-commutative54.1%
Simplified54.1%
if -2.9e-4 < y < 1.10000000000000004e-4Initial program 99.5%
Simplified99.6%
Taylor expanded in y around 0 99.0%
distribute-lft-out99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around 0 99.0%
associate-*r*99.0%
distribute-rgt-out99.0%
sub-neg99.0%
metadata-eval99.0%
*-commutative99.0%
Simplified99.0%
flip--99.3%
metadata-eval99.3%
pow1/299.3%
pow1/299.3%
pow-prod-up99.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.0%
+-commutative99.6%
Simplified99.0%
Final simplification77.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sqrt 5.0) 2.0))
(t_1
(* 3.0 (+ 1.0 (+ (* (cos x) (- t_0 0.5)) (* (cos y) (- 1.5 t_0)))))))
(if (<= y -0.00045)
(/
(+
2.0
(*
(- (cos x) (cos y))
(* -0.0625 (pow (* (sin y) (pow 2.0 0.25)) 2.0))))
t_1)
(if (<= y 0.00011)
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ (cos x) -1.0) (+ (sin x) (* y -0.0625))))
2.0)
(+
3.0
(*
1.5
(+ (/ 4.0 (+ 3.0 (sqrt 5.0))) (* (cos x) (+ (sqrt 5.0) -1.0))))))
(/
(+
2.0
(* (- 1.0 (cos y)) (* -0.0625 (* (sqrt 2.0) (pow (sin y) 2.0)))))
t_1)))))
double code(double x, double y) {
double t_0 = sqrt(5.0) / 2.0;
double t_1 = 3.0 * (1.0 + ((cos(x) * (t_0 - 0.5)) + (cos(y) * (1.5 - t_0))));
double tmp;
if (y <= -0.00045) {
tmp = (2.0 + ((cos(x) - cos(y)) * (-0.0625 * pow((sin(y) * pow(2.0, 0.25)), 2.0)))) / t_1;
} else if (y <= 0.00011) {
tmp = fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((cos(x) + -1.0) * (sin(x) + (y * -0.0625)))), 2.0) / (3.0 + (1.5 * ((4.0 / (3.0 + sqrt(5.0))) + (cos(x) * (sqrt(5.0) + -1.0)))));
} else {
tmp = (2.0 + ((1.0 - cos(y)) * (-0.0625 * (sqrt(2.0) * pow(sin(y), 2.0))))) / t_1;
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) / 2.0) t_1 = Float64(3.0 * Float64(1.0 + Float64(Float64(cos(x) * Float64(t_0 - 0.5)) + Float64(cos(y) * Float64(1.5 - t_0))))) tmp = 0.0 if (y <= -0.00045) tmp = Float64(Float64(2.0 + Float64(Float64(cos(x) - cos(y)) * Float64(-0.0625 * (Float64(sin(y) * (2.0 ^ 0.25)) ^ 2.0)))) / t_1); elseif (y <= 0.00011) tmp = Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(cos(x) + -1.0) * Float64(sin(x) + Float64(y * -0.0625)))), 2.0) / Float64(3.0 + Float64(1.5 * Float64(Float64(4.0 / Float64(3.0 + sqrt(5.0))) + Float64(cos(x) * Float64(sqrt(5.0) + -1.0)))))); else tmp = Float64(Float64(2.0 + Float64(Float64(1.0 - cos(y)) * Float64(-0.0625 * Float64(sqrt(2.0) * (sin(y) ^ 2.0))))) / t_1); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(1.0 + N[(N[(N[Cos[x], $MachinePrecision] * N[(t$95$0 - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(1.5 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.00045], N[(N[(2.0 + N[(N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Power[N[(N[Sin[y], $MachinePrecision] * N[Power[2.0, 0.25], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 0.00011], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] + -1.0), $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] + N[(y * -0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(1.5 * N[(N[(4.0 / N[(3.0 + N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[x], $MachinePrecision] * N[(N[Sqrt[5.0], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{5}}{2}\\
t_1 := 3 \cdot \left(1 + \left(\cos x \cdot \left(t\_0 - 0.5\right) + \cos y \cdot \left(1.5 - t\_0\right)\right)\right)\\
\mathbf{if}\;y \leq -0.00045:\\
\;\;\;\;\frac{2 + \left(\cos x - \cos y\right) \cdot \left(-0.0625 \cdot {\left(\sin y \cdot {2}^{0.25}\right)}^{2}\right)}{t\_1}\\
\mathbf{elif}\;y \leq 0.00011:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(\cos x + -1\right) \cdot \left(\sin x + y \cdot -0.0625\right)\right), 2\right)}{3 + 1.5 \cdot \left(\frac{4}{3 + \sqrt{5}} + \cos x \cdot \left(\sqrt{5} + -1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \left(1 - \cos y\right) \cdot \left(-0.0625 \cdot \left(\sqrt{2} \cdot {\sin y}^{2}\right)\right)}{t\_1}\\
\end{array}
\end{array}
if y < -4.4999999999999999e-4Initial program 99.2%
associate-*l*99.3%
distribute-rgt-in99.3%
cos-neg99.3%
distribute-rgt-in99.3%
associate-+l+99.2%
Simplified99.2%
Taylor expanded in x around 0 53.9%
add-sqr-sqrt53.9%
pow253.9%
sqrt-prod53.9%
sqrt-pow153.9%
metadata-eval53.9%
pow153.9%
pow1/253.9%
sqrt-pow153.9%
metadata-eval53.9%
Applied egg-rr53.9%
if -4.4999999999999999e-4 < y < 1.10000000000000004e-4Initial program 99.5%
Simplified99.6%
Taylor expanded in y around 0 99.0%
distribute-lft-out99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around 0 99.0%
associate-*r*99.0%
distribute-rgt-out99.0%
sub-neg99.0%
metadata-eval99.0%
*-commutative99.0%
Simplified99.0%
flip--99.3%
metadata-eval99.3%
pow1/299.3%
pow1/299.3%
pow-prod-up99.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.0%
+-commutative99.6%
Simplified99.0%
if 1.10000000000000004e-4 < y Initial program 99.0%
associate-*l*99.0%
distribute-rgt-in99.1%
cos-neg99.1%
distribute-rgt-in99.0%
associate-+l+99.0%
Simplified99.0%
Taylor expanded in x around 0 54.1%
Taylor expanded in x around 0 54.3%
Final simplification77.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sqrt 5.0) 2.0)))
(if (or (<= y -0.00046) (not (<= y 0.000106)))
(/
(+ 2.0 (* (- 1.0 (cos y)) (* -0.0625 (* (sqrt 2.0) (pow (sin y) 2.0)))))
(* 3.0 (+ 1.0 (+ (* (cos x) (- t_0 0.5)) (* (cos y) (- 1.5 t_0))))))
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ (cos x) -1.0) (+ (sin x) (* y -0.0625))))
2.0)
(+
3.0
(* 1.5 (+ (- 3.0 (sqrt 5.0)) (* (cos x) (+ (sqrt 5.0) -1.0)))))))))
double code(double x, double y) {
double t_0 = sqrt(5.0) / 2.0;
double tmp;
if ((y <= -0.00046) || !(y <= 0.000106)) {
tmp = (2.0 + ((1.0 - cos(y)) * (-0.0625 * (sqrt(2.0) * pow(sin(y), 2.0))))) / (3.0 * (1.0 + ((cos(x) * (t_0 - 0.5)) + (cos(y) * (1.5 - t_0)))));
} else {
tmp = fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((cos(x) + -1.0) * (sin(x) + (y * -0.0625)))), 2.0) / (3.0 + (1.5 * ((3.0 - sqrt(5.0)) + (cos(x) * (sqrt(5.0) + -1.0)))));
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) / 2.0) tmp = 0.0 if ((y <= -0.00046) || !(y <= 0.000106)) tmp = Float64(Float64(2.0 + Float64(Float64(1.0 - cos(y)) * Float64(-0.0625 * Float64(sqrt(2.0) * (sin(y) ^ 2.0))))) / Float64(3.0 * Float64(1.0 + Float64(Float64(cos(x) * Float64(t_0 - 0.5)) + Float64(cos(y) * Float64(1.5 - t_0)))))); else tmp = Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(cos(x) + -1.0) * Float64(sin(x) + Float64(y * -0.0625)))), 2.0) / Float64(3.0 + Float64(1.5 * Float64(Float64(3.0 - sqrt(5.0)) + Float64(cos(x) * Float64(sqrt(5.0) + -1.0)))))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] / 2.0), $MachinePrecision]}, If[Or[LessEqual[y, -0.00046], N[Not[LessEqual[y, 0.000106]], $MachinePrecision]], N[(N[(2.0 + N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(1.0 + N[(N[(N[Cos[x], $MachinePrecision] * N[(t$95$0 - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(1.5 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] + -1.0), $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] + N[(y * -0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(1.5 * N[(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]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{5}}{2}\\
\mathbf{if}\;y \leq -0.00046 \lor \neg \left(y \leq 0.000106\right):\\
\;\;\;\;\frac{2 + \left(1 - \cos y\right) \cdot \left(-0.0625 \cdot \left(\sqrt{2} \cdot {\sin y}^{2}\right)\right)}{3 \cdot \left(1 + \left(\cos x \cdot \left(t\_0 - 0.5\right) + \cos y \cdot \left(1.5 - t\_0\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(\cos x + -1\right) \cdot \left(\sin x + y \cdot -0.0625\right)\right), 2\right)}{3 + 1.5 \cdot \left(\left(3 - \sqrt{5}\right) + \cos x \cdot \left(\sqrt{5} + -1\right)\right)}\\
\end{array}
\end{array}
if y < -4.6000000000000001e-4 or 1.06e-4 < y Initial program 99.1%
associate-*l*99.2%
distribute-rgt-in99.2%
cos-neg99.2%
distribute-rgt-in99.2%
associate-+l+99.1%
Simplified99.1%
Taylor expanded in x around 0 54.0%
Taylor expanded in x around 0 54.0%
if -4.6000000000000001e-4 < y < 1.06e-4Initial program 99.5%
Simplified99.6%
Taylor expanded in y around 0 99.0%
distribute-lft-out99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around 0 99.0%
associate-*r*99.0%
distribute-rgt-out99.0%
sub-neg99.0%
metadata-eval99.0%
*-commutative99.0%
Simplified99.0%
Final simplification77.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sqrt 5.0) 2.0))
(t_1
(* 3.0 (+ 1.0 (+ (* (cos x) (- t_0 0.5)) (* (cos y) (- 1.5 t_0))))))
(t_2 (* -0.0625 (* (sqrt 2.0) (pow (sin y) 2.0)))))
(if (<= y -0.000135)
(/ (+ 2.0 (* (- (cos x) (cos y)) t_2)) t_1)
(if (<= y 0.00011)
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ (cos x) -1.0) (+ (sin x) (* y -0.0625))))
2.0)
(+ 3.0 (* 1.5 (+ (- 3.0 (sqrt 5.0)) (* (cos x) (+ (sqrt 5.0) -1.0))))))
(/ (+ 2.0 (* (- 1.0 (cos y)) t_2)) t_1)))))
double code(double x, double y) {
double t_0 = sqrt(5.0) / 2.0;
double t_1 = 3.0 * (1.0 + ((cos(x) * (t_0 - 0.5)) + (cos(y) * (1.5 - t_0))));
double t_2 = -0.0625 * (sqrt(2.0) * pow(sin(y), 2.0));
double tmp;
if (y <= -0.000135) {
tmp = (2.0 + ((cos(x) - cos(y)) * t_2)) / t_1;
} else if (y <= 0.00011) {
tmp = fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((cos(x) + -1.0) * (sin(x) + (y * -0.0625)))), 2.0) / (3.0 + (1.5 * ((3.0 - sqrt(5.0)) + (cos(x) * (sqrt(5.0) + -1.0)))));
} else {
tmp = (2.0 + ((1.0 - cos(y)) * t_2)) / t_1;
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) / 2.0) t_1 = Float64(3.0 * Float64(1.0 + Float64(Float64(cos(x) * Float64(t_0 - 0.5)) + Float64(cos(y) * Float64(1.5 - t_0))))) t_2 = Float64(-0.0625 * Float64(sqrt(2.0) * (sin(y) ^ 2.0))) tmp = 0.0 if (y <= -0.000135) tmp = Float64(Float64(2.0 + Float64(Float64(cos(x) - cos(y)) * t_2)) / t_1); elseif (y <= 0.00011) tmp = Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(cos(x) + -1.0) * Float64(sin(x) + Float64(y * -0.0625)))), 2.0) / Float64(3.0 + Float64(1.5 * Float64(Float64(3.0 - sqrt(5.0)) + Float64(cos(x) * Float64(sqrt(5.0) + -1.0)))))); else tmp = Float64(Float64(2.0 + Float64(Float64(1.0 - cos(y)) * t_2)) / t_1); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(1.0 + N[(N[(N[Cos[x], $MachinePrecision] * N[(t$95$0 - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(1.5 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-0.0625 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.000135], N[(N[(2.0 + N[(N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 0.00011], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] + -1.0), $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] + N[(y * -0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(1.5 * N[(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]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{5}}{2}\\
t_1 := 3 \cdot \left(1 + \left(\cos x \cdot \left(t\_0 - 0.5\right) + \cos y \cdot \left(1.5 - t\_0\right)\right)\right)\\
t_2 := -0.0625 \cdot \left(\sqrt{2} \cdot {\sin y}^{2}\right)\\
\mathbf{if}\;y \leq -0.000135:\\
\;\;\;\;\frac{2 + \left(\cos x - \cos y\right) \cdot t\_2}{t\_1}\\
\mathbf{elif}\;y \leq 0.00011:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(\cos x + -1\right) \cdot \left(\sin x + y \cdot -0.0625\right)\right), 2\right)}{3 + 1.5 \cdot \left(\left(3 - \sqrt{5}\right) + \cos x \cdot \left(\sqrt{5} + -1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \left(1 - \cos y\right) \cdot t\_2}{t\_1}\\
\end{array}
\end{array}
if y < -1.35000000000000002e-4Initial program 99.2%
associate-*l*99.3%
distribute-rgt-in99.3%
cos-neg99.3%
distribute-rgt-in99.3%
associate-+l+99.2%
Simplified99.2%
Taylor expanded in x around 0 53.9%
if -1.35000000000000002e-4 < y < 1.10000000000000004e-4Initial program 99.5%
Simplified99.6%
Taylor expanded in y around 0 99.0%
distribute-lft-out99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around 0 99.0%
associate-*r*99.0%
distribute-rgt-out99.0%
sub-neg99.0%
metadata-eval99.0%
*-commutative99.0%
Simplified99.0%
if 1.10000000000000004e-4 < y Initial program 99.0%
associate-*l*99.0%
distribute-rgt-in99.1%
cos-neg99.1%
distribute-rgt-in99.0%
associate-+l+99.0%
Simplified99.0%
Taylor expanded in x around 0 54.1%
Taylor expanded in x around 0 54.3%
Final simplification77.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sqrt 5.0) 2.0))
(t_1
(* 3.0 (+ 1.0 (+ (* (cos x) (- t_0 0.5)) (* (cos y) (- 1.5 t_0)))))))
(if (<= y -0.00017)
(/
(+
2.0
(*
(- (cos x) (cos y))
(* -0.0625 (pow (* (sin y) (pow 2.0 0.25)) 2.0))))
t_1)
(if (<= y 0.00011)
(/
(fma
(sqrt 2.0)
(*
(+ (sin y) (* (sin x) -0.0625))
(* (+ (cos x) -1.0) (+ (sin x) (* y -0.0625))))
2.0)
(+ 3.0 (* 1.5 (+ (- 3.0 (sqrt 5.0)) (* (cos x) (+ (sqrt 5.0) -1.0))))))
(/
(+
2.0
(* (- 1.0 (cos y)) (* -0.0625 (* (sqrt 2.0) (pow (sin y) 2.0)))))
t_1)))))
double code(double x, double y) {
double t_0 = sqrt(5.0) / 2.0;
double t_1 = 3.0 * (1.0 + ((cos(x) * (t_0 - 0.5)) + (cos(y) * (1.5 - t_0))));
double tmp;
if (y <= -0.00017) {
tmp = (2.0 + ((cos(x) - cos(y)) * (-0.0625 * pow((sin(y) * pow(2.0, 0.25)), 2.0)))) / t_1;
} else if (y <= 0.00011) {
tmp = fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * ((cos(x) + -1.0) * (sin(x) + (y * -0.0625)))), 2.0) / (3.0 + (1.5 * ((3.0 - sqrt(5.0)) + (cos(x) * (sqrt(5.0) + -1.0)))));
} else {
tmp = (2.0 + ((1.0 - cos(y)) * (-0.0625 * (sqrt(2.0) * pow(sin(y), 2.0))))) / t_1;
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) / 2.0) t_1 = Float64(3.0 * Float64(1.0 + Float64(Float64(cos(x) * Float64(t_0 - 0.5)) + Float64(cos(y) * Float64(1.5 - t_0))))) tmp = 0.0 if (y <= -0.00017) tmp = Float64(Float64(2.0 + Float64(Float64(cos(x) - cos(y)) * Float64(-0.0625 * (Float64(sin(y) * (2.0 ^ 0.25)) ^ 2.0)))) / t_1); elseif (y <= 0.00011) tmp = Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(Float64(cos(x) + -1.0) * Float64(sin(x) + Float64(y * -0.0625)))), 2.0) / Float64(3.0 + Float64(1.5 * Float64(Float64(3.0 - sqrt(5.0)) + Float64(cos(x) * Float64(sqrt(5.0) + -1.0)))))); else tmp = Float64(Float64(2.0 + Float64(Float64(1.0 - cos(y)) * Float64(-0.0625 * Float64(sqrt(2.0) * (sin(y) ^ 2.0))))) / t_1); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(1.0 + N[(N[(N[Cos[x], $MachinePrecision] * N[(t$95$0 - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(1.5 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.00017], N[(N[(2.0 + N[(N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Power[N[(N[Sin[y], $MachinePrecision] * N[Power[2.0, 0.25], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 0.00011], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] + -1.0), $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] + N[(y * -0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(1.5 * N[(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]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{5}}{2}\\
t_1 := 3 \cdot \left(1 + \left(\cos x \cdot \left(t\_0 - 0.5\right) + \cos y \cdot \left(1.5 - t\_0\right)\right)\right)\\
\mathbf{if}\;y \leq -0.00017:\\
\;\;\;\;\frac{2 + \left(\cos x - \cos y\right) \cdot \left(-0.0625 \cdot {\left(\sin y \cdot {2}^{0.25}\right)}^{2}\right)}{t\_1}\\
\mathbf{elif}\;y \leq 0.00011:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\left(\cos x + -1\right) \cdot \left(\sin x + y \cdot -0.0625\right)\right), 2\right)}{3 + 1.5 \cdot \left(\left(3 - \sqrt{5}\right) + \cos x \cdot \left(\sqrt{5} + -1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \left(1 - \cos y\right) \cdot \left(-0.0625 \cdot \left(\sqrt{2} \cdot {\sin y}^{2}\right)\right)}{t\_1}\\
\end{array}
\end{array}
if y < -1.7e-4Initial program 99.2%
associate-*l*99.3%
distribute-rgt-in99.3%
cos-neg99.3%
distribute-rgt-in99.3%
associate-+l+99.2%
Simplified99.2%
Taylor expanded in x around 0 53.9%
add-sqr-sqrt53.9%
pow253.9%
sqrt-prod53.9%
sqrt-pow153.9%
metadata-eval53.9%
pow153.9%
pow1/253.9%
sqrt-pow153.9%
metadata-eval53.9%
Applied egg-rr53.9%
if -1.7e-4 < y < 1.10000000000000004e-4Initial program 99.5%
Simplified99.6%
Taylor expanded in y around 0 99.0%
distribute-lft-out99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around 0 99.0%
associate-*r*99.0%
distribute-rgt-out99.0%
sub-neg99.0%
metadata-eval99.0%
*-commutative99.0%
Simplified99.0%
if 1.10000000000000004e-4 < y Initial program 99.0%
associate-*l*99.0%
distribute-rgt-in99.1%
cos-neg99.1%
distribute-rgt-in99.0%
associate-+l+99.0%
Simplified99.0%
Taylor expanded in x around 0 54.1%
Taylor expanded in x around 0 54.3%
Final simplification77.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sqrt 5.0) 2.0)))
(if (or (<= y -2.25e+17) (not (<= y 0.00011)))
(/
(+ 2.0 (* (- 1.0 (cos y)) (* -0.0625 (* (sqrt 2.0) (pow (sin y) 2.0)))))
(* 3.0 (+ 1.0 (+ (* (cos x) (- t_0 0.5)) (* (cos y) (- 1.5 t_0))))))
(/
(fma
(sqrt 2.0)
(* (+ (sin y) (* (sin x) -0.0625)) (* (sin x) (+ (cos x) -1.0)))
2.0)
(+
3.0
(* 1.5 (+ (- 3.0 (sqrt 5.0)) (* (cos x) (+ (sqrt 5.0) -1.0)))))))))
double code(double x, double y) {
double t_0 = sqrt(5.0) / 2.0;
double tmp;
if ((y <= -2.25e+17) || !(y <= 0.00011)) {
tmp = (2.0 + ((1.0 - cos(y)) * (-0.0625 * (sqrt(2.0) * pow(sin(y), 2.0))))) / (3.0 * (1.0 + ((cos(x) * (t_0 - 0.5)) + (cos(y) * (1.5 - t_0)))));
} else {
tmp = fma(sqrt(2.0), ((sin(y) + (sin(x) * -0.0625)) * (sin(x) * (cos(x) + -1.0))), 2.0) / (3.0 + (1.5 * ((3.0 - sqrt(5.0)) + (cos(x) * (sqrt(5.0) + -1.0)))));
}
return tmp;
}
function code(x, y) t_0 = Float64(sqrt(5.0) / 2.0) tmp = 0.0 if ((y <= -2.25e+17) || !(y <= 0.00011)) tmp = Float64(Float64(2.0 + Float64(Float64(1.0 - cos(y)) * Float64(-0.0625 * Float64(sqrt(2.0) * (sin(y) ^ 2.0))))) / Float64(3.0 * Float64(1.0 + Float64(Float64(cos(x) * Float64(t_0 - 0.5)) + Float64(cos(y) * Float64(1.5 - t_0)))))); else tmp = Float64(fma(sqrt(2.0), Float64(Float64(sin(y) + Float64(sin(x) * -0.0625)) * Float64(sin(x) * Float64(cos(x) + -1.0))), 2.0) / Float64(3.0 + Float64(1.5 * Float64(Float64(3.0 - sqrt(5.0)) + Float64(cos(x) * Float64(sqrt(5.0) + -1.0)))))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] / 2.0), $MachinePrecision]}, If[Or[LessEqual[y, -2.25e+17], N[Not[LessEqual[y, 0.00011]], $MachinePrecision]], N[(N[(2.0 + N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(1.0 + N[(N[(N[Cos[x], $MachinePrecision] * N[(t$95$0 - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(1.5 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sin[y], $MachinePrecision] + N[(N[Sin[x], $MachinePrecision] * -0.0625), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 + N[(1.5 * N[(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]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{5}}{2}\\
\mathbf{if}\;y \leq -2.25 \cdot 10^{+17} \lor \neg \left(y \leq 0.00011\right):\\
\;\;\;\;\frac{2 + \left(1 - \cos y\right) \cdot \left(-0.0625 \cdot \left(\sqrt{2} \cdot {\sin y}^{2}\right)\right)}{3 \cdot \left(1 + \left(\cos x \cdot \left(t\_0 - 0.5\right) + \cos y \cdot \left(1.5 - t\_0\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{2}, \left(\sin y + \sin x \cdot -0.0625\right) \cdot \left(\sin x \cdot \left(\cos x + -1\right)\right), 2\right)}{3 + 1.5 \cdot \left(\left(3 - \sqrt{5}\right) + \cos x \cdot \left(\sqrt{5} + -1\right)\right)}\\
\end{array}
\end{array}
if y < -2.25e17 or 1.10000000000000004e-4 < y Initial program 99.1%
associate-*l*99.1%
distribute-rgt-in99.2%
cos-neg99.2%
distribute-rgt-in99.1%
associate-+l+99.1%
Simplified99.1%
Taylor expanded in x around 0 55.0%
Taylor expanded in x around 0 55.1%
if -2.25e17 < y < 1.10000000000000004e-4Initial program 99.5%
Simplified99.5%
Taylor expanded in y around 0 96.9%
distribute-lft-out96.9%
sub-neg96.9%
metadata-eval96.9%
Simplified96.9%
Taylor expanded in y around 0 96.6%
Final simplification77.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (sqrt 5.0) 2.0)))
(/
(+ 2.0 (* (- 1.0 (cos y)) (* -0.0625 (* (sqrt 2.0) (pow (sin y) 2.0)))))
(* 3.0 (+ 1.0 (+ (* (cos x) (- t_0 0.5)) (* (cos y) (- 1.5 t_0))))))))
double code(double x, double y) {
double t_0 = sqrt(5.0) / 2.0;
return (2.0 + ((1.0 - cos(y)) * (-0.0625 * (sqrt(2.0) * pow(sin(y), 2.0))))) / (3.0 * (1.0 + ((cos(x) * (t_0 - 0.5)) + (cos(y) * (1.5 - t_0)))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = sqrt(5.0d0) / 2.0d0
code = (2.0d0 + ((1.0d0 - cos(y)) * ((-0.0625d0) * (sqrt(2.0d0) * (sin(y) ** 2.0d0))))) / (3.0d0 * (1.0d0 + ((cos(x) * (t_0 - 0.5d0)) + (cos(y) * (1.5d0 - t_0)))))
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt(5.0) / 2.0;
return (2.0 + ((1.0 - Math.cos(y)) * (-0.0625 * (Math.sqrt(2.0) * Math.pow(Math.sin(y), 2.0))))) / (3.0 * (1.0 + ((Math.cos(x) * (t_0 - 0.5)) + (Math.cos(y) * (1.5 - t_0)))));
}
def code(x, y): t_0 = math.sqrt(5.0) / 2.0 return (2.0 + ((1.0 - math.cos(y)) * (-0.0625 * (math.sqrt(2.0) * math.pow(math.sin(y), 2.0))))) / (3.0 * (1.0 + ((math.cos(x) * (t_0 - 0.5)) + (math.cos(y) * (1.5 - t_0)))))
function code(x, y) t_0 = Float64(sqrt(5.0) / 2.0) return Float64(Float64(2.0 + Float64(Float64(1.0 - cos(y)) * Float64(-0.0625 * Float64(sqrt(2.0) * (sin(y) ^ 2.0))))) / Float64(3.0 * Float64(1.0 + Float64(Float64(cos(x) * Float64(t_0 - 0.5)) + Float64(cos(y) * Float64(1.5 - t_0)))))) end
function tmp = code(x, y) t_0 = sqrt(5.0) / 2.0; tmp = (2.0 + ((1.0 - cos(y)) * (-0.0625 * (sqrt(2.0) * (sin(y) ^ 2.0))))) / (3.0 * (1.0 + ((cos(x) * (t_0 - 0.5)) + (cos(y) * (1.5 - t_0))))); end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] / 2.0), $MachinePrecision]}, N[(N[(2.0 + N[(N[(1.0 - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(1.0 + N[(N[(N[Cos[x], $MachinePrecision] * N[(t$95$0 - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(1.5 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{5}}{2}\\
\frac{2 + \left(1 - \cos y\right) \cdot \left(-0.0625 \cdot \left(\sqrt{2} \cdot {\sin y}^{2}\right)\right)}{3 \cdot \left(1 + \left(\cos x \cdot \left(t\_0 - 0.5\right) + \cos y \cdot \left(1.5 - t\_0\right)\right)\right)}
\end{array}
\end{array}
Initial program 99.3%
associate-*l*99.4%
distribute-rgt-in99.4%
cos-neg99.4%
distribute-rgt-in99.4%
associate-+l+99.3%
Simplified99.3%
Taylor expanded in x around 0 60.0%
Taylor expanded in x around 0 60.0%
Final simplification60.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt 5.0) 0.5)))
(/
(+
2.0
(* (- (cos x) (cos y)) (* -0.0625 (* (sqrt 2.0) (pow (sin y) 2.0)))))
(* 3.0 (+ 1.0 (- (+ 1.5 (* (cos x) (- t_0 0.5))) t_0))))))
double code(double x, double y) {
double t_0 = sqrt(5.0) * 0.5;
return (2.0 + ((cos(x) - cos(y)) * (-0.0625 * (sqrt(2.0) * pow(sin(y), 2.0))))) / (3.0 * (1.0 + ((1.5 + (cos(x) * (t_0 - 0.5))) - t_0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = sqrt(5.0d0) * 0.5d0
code = (2.0d0 + ((cos(x) - cos(y)) * ((-0.0625d0) * (sqrt(2.0d0) * (sin(y) ** 2.0d0))))) / (3.0d0 * (1.0d0 + ((1.5d0 + (cos(x) * (t_0 - 0.5d0))) - t_0)))
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt(5.0) * 0.5;
return (2.0 + ((Math.cos(x) - Math.cos(y)) * (-0.0625 * (Math.sqrt(2.0) * Math.pow(Math.sin(y), 2.0))))) / (3.0 * (1.0 + ((1.5 + (Math.cos(x) * (t_0 - 0.5))) - t_0)));
}
def code(x, y): t_0 = math.sqrt(5.0) * 0.5 return (2.0 + ((math.cos(x) - math.cos(y)) * (-0.0625 * (math.sqrt(2.0) * math.pow(math.sin(y), 2.0))))) / (3.0 * (1.0 + ((1.5 + (math.cos(x) * (t_0 - 0.5))) - t_0)))
function code(x, y) t_0 = Float64(sqrt(5.0) * 0.5) return Float64(Float64(2.0 + Float64(Float64(cos(x) - cos(y)) * Float64(-0.0625 * Float64(sqrt(2.0) * (sin(y) ^ 2.0))))) / Float64(3.0 * Float64(1.0 + Float64(Float64(1.5 + Float64(cos(x) * Float64(t_0 - 0.5))) - t_0)))) end
function tmp = code(x, y) t_0 = sqrt(5.0) * 0.5; tmp = (2.0 + ((cos(x) - cos(y)) * (-0.0625 * (sqrt(2.0) * (sin(y) ^ 2.0))))) / (3.0 * (1.0 + ((1.5 + (cos(x) * (t_0 - 0.5))) - t_0))); end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] * 0.5), $MachinePrecision]}, N[(N[(2.0 + N[(N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(1.0 + N[(N[(1.5 + N[(N[Cos[x], $MachinePrecision] * N[(t$95$0 - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{5} \cdot 0.5\\
\frac{2 + \left(\cos x - \cos y\right) \cdot \left(-0.0625 \cdot \left(\sqrt{2} \cdot {\sin y}^{2}\right)\right)}{3 \cdot \left(1 + \left(\left(1.5 + \cos x \cdot \left(t\_0 - 0.5\right)\right) - t\_0\right)\right)}
\end{array}
\end{array}
Initial program 99.3%
associate-*l*99.4%
distribute-rgt-in99.4%
cos-neg99.4%
distribute-rgt-in99.4%
associate-+l+99.3%
Simplified99.3%
Taylor expanded in x around 0 60.0%
Taylor expanded in y around 0 44.8%
Final simplification44.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt 5.0) 0.5)))
(/
(+
2.0
(* (- (cos x) (cos y)) (* -0.0625 (* (sqrt 2.0) (pow (sin y) 2.0)))))
(* 3.0 (+ 1.0 (- (+ t_0 (* (cos y) (- 1.5 t_0))) 0.5))))))
double code(double x, double y) {
double t_0 = sqrt(5.0) * 0.5;
return (2.0 + ((cos(x) - cos(y)) * (-0.0625 * (sqrt(2.0) * pow(sin(y), 2.0))))) / (3.0 * (1.0 + ((t_0 + (cos(y) * (1.5 - t_0))) - 0.5)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = sqrt(5.0d0) * 0.5d0
code = (2.0d0 + ((cos(x) - cos(y)) * ((-0.0625d0) * (sqrt(2.0d0) * (sin(y) ** 2.0d0))))) / (3.0d0 * (1.0d0 + ((t_0 + (cos(y) * (1.5d0 - t_0))) - 0.5d0)))
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt(5.0) * 0.5;
return (2.0 + ((Math.cos(x) - Math.cos(y)) * (-0.0625 * (Math.sqrt(2.0) * Math.pow(Math.sin(y), 2.0))))) / (3.0 * (1.0 + ((t_0 + (Math.cos(y) * (1.5 - t_0))) - 0.5)));
}
def code(x, y): t_0 = math.sqrt(5.0) * 0.5 return (2.0 + ((math.cos(x) - math.cos(y)) * (-0.0625 * (math.sqrt(2.0) * math.pow(math.sin(y), 2.0))))) / (3.0 * (1.0 + ((t_0 + (math.cos(y) * (1.5 - t_0))) - 0.5)))
function code(x, y) t_0 = Float64(sqrt(5.0) * 0.5) return Float64(Float64(2.0 + Float64(Float64(cos(x) - cos(y)) * Float64(-0.0625 * Float64(sqrt(2.0) * (sin(y) ^ 2.0))))) / Float64(3.0 * Float64(1.0 + Float64(Float64(t_0 + Float64(cos(y) * Float64(1.5 - t_0))) - 0.5)))) end
function tmp = code(x, y) t_0 = sqrt(5.0) * 0.5; tmp = (2.0 + ((cos(x) - cos(y)) * (-0.0625 * (sqrt(2.0) * (sin(y) ^ 2.0))))) / (3.0 * (1.0 + ((t_0 + (cos(y) * (1.5 - t_0))) - 0.5))); end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[5.0], $MachinePrecision] * 0.5), $MachinePrecision]}, N[(N[(2.0 + N[(N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(1.0 + N[(N[(t$95$0 + N[(N[Cos[y], $MachinePrecision] * N[(1.5 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{5} \cdot 0.5\\
\frac{2 + \left(\cos x - \cos y\right) \cdot \left(-0.0625 \cdot \left(\sqrt{2} \cdot {\sin y}^{2}\right)\right)}{3 \cdot \left(1 + \left(\left(t\_0 + \cos y \cdot \left(1.5 - t\_0\right)\right) - 0.5\right)\right)}
\end{array}
\end{array}
Initial program 99.3%
associate-*l*99.4%
distribute-rgt-in99.4%
cos-neg99.4%
distribute-rgt-in99.4%
associate-+l+99.3%
Simplified99.3%
Taylor expanded in x around 0 60.0%
Taylor expanded in x around 0 56.9%
Final simplification56.9%
(FPCore (x y) :precision binary64 (/ (fma (sqrt 2.0) (* (pow (sin x) 2.0) (+ (* -0.0625 (cos x)) 0.0625)) 2.0) 6.0))
double code(double x, double y) {
return fma(sqrt(2.0), (pow(sin(x), 2.0) * ((-0.0625 * cos(x)) + 0.0625)), 2.0) / 6.0;
}
function code(x, y) return Float64(fma(sqrt(2.0), Float64((sin(x) ^ 2.0) * Float64(Float64(-0.0625 * cos(x)) + 0.0625)), 2.0) / 6.0) end
code[x_, y_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(-0.0625 * N[Cos[x], $MachinePrecision]), $MachinePrecision] + 0.0625), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / 6.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(\sqrt{2}, {\sin x}^{2} \cdot \left(-0.0625 \cdot \cos x + 0.0625\right), 2\right)}{6}
\end{array}
Initial program 99.3%
Simplified99.3%
Taylor expanded in y around 0 62.9%
distribute-lft-out62.9%
sub-neg62.9%
metadata-eval62.9%
Simplified62.9%
Taylor expanded in x around 0 42.2%
Taylor expanded in y around 0 42.3%
*-commutative42.3%
associate-*l*42.3%
*-commutative42.3%
sub-neg42.3%
metadata-eval42.3%
distribute-lft-in42.3%
metadata-eval42.3%
Simplified42.3%
Final simplification42.3%
(FPCore (x y) :precision binary64 (+ 0.3333333333333333 (* (* (+ (cos x) -1.0) (* (sqrt 2.0) (- 0.5 (/ (cos (* 2.0 x)) 2.0)))) -0.010416666666666666)))
double code(double x, double y) {
return 0.3333333333333333 + (((cos(x) + -1.0) * (sqrt(2.0) * (0.5 - (cos((2.0 * x)) / 2.0)))) * -0.010416666666666666);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.3333333333333333d0 + (((cos(x) + (-1.0d0)) * (sqrt(2.0d0) * (0.5d0 - (cos((2.0d0 * x)) / 2.0d0)))) * (-0.010416666666666666d0))
end function
public static double code(double x, double y) {
return 0.3333333333333333 + (((Math.cos(x) + -1.0) * (Math.sqrt(2.0) * (0.5 - (Math.cos((2.0 * x)) / 2.0)))) * -0.010416666666666666);
}
def code(x, y): return 0.3333333333333333 + (((math.cos(x) + -1.0) * (math.sqrt(2.0) * (0.5 - (math.cos((2.0 * x)) / 2.0)))) * -0.010416666666666666)
function code(x, y) return Float64(0.3333333333333333 + Float64(Float64(Float64(cos(x) + -1.0) * Float64(sqrt(2.0) * Float64(0.5 - Float64(cos(Float64(2.0 * x)) / 2.0)))) * -0.010416666666666666)) end
function tmp = code(x, y) tmp = 0.3333333333333333 + (((cos(x) + -1.0) * (sqrt(2.0) * (0.5 - (cos((2.0 * x)) / 2.0)))) * -0.010416666666666666); end
code[x_, y_] := N[(0.3333333333333333 + N[(N[(N[(N[Cos[x], $MachinePrecision] + -1.0), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(0.5 - N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.010416666666666666), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.3333333333333333 + \left(\left(\cos x + -1\right) \cdot \left(\sqrt{2} \cdot \left(0.5 - \frac{\cos \left(2 \cdot x\right)}{2}\right)\right)\right) \cdot -0.010416666666666666
\end{array}
Initial program 99.3%
Simplified99.3%
Taylor expanded in y around 0 62.9%
distribute-lft-out62.9%
sub-neg62.9%
metadata-eval62.9%
Simplified62.9%
Taylor expanded in x around 0 42.2%
Taylor expanded in y around 0 42.3%
distribute-rgt-in42.3%
metadata-eval42.3%
*-commutative42.3%
associate-*l*42.3%
associate-*r*42.3%
*-commutative42.3%
sub-neg42.3%
metadata-eval42.3%
metadata-eval42.3%
Simplified42.3%
unpow242.3%
sin-mult42.3%
Applied egg-rr42.3%
div-sub42.3%
+-inverses42.3%
cos-042.3%
metadata-eval42.3%
count-242.3%
*-commutative42.3%
Simplified42.3%
Final simplification42.3%
(FPCore (x y) :precision binary64 (+ 0.3333333333333333 (* -0.010416666666666666 (* (+ (cos x) -1.0) (* (sqrt 2.0) (pow x 2.0))))))
double code(double x, double y) {
return 0.3333333333333333 + (-0.010416666666666666 * ((cos(x) + -1.0) * (sqrt(2.0) * pow(x, 2.0))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.3333333333333333d0 + ((-0.010416666666666666d0) * ((cos(x) + (-1.0d0)) * (sqrt(2.0d0) * (x ** 2.0d0))))
end function
public static double code(double x, double y) {
return 0.3333333333333333 + (-0.010416666666666666 * ((Math.cos(x) + -1.0) * (Math.sqrt(2.0) * Math.pow(x, 2.0))));
}
def code(x, y): return 0.3333333333333333 + (-0.010416666666666666 * ((math.cos(x) + -1.0) * (math.sqrt(2.0) * math.pow(x, 2.0))))
function code(x, y) return Float64(0.3333333333333333 + Float64(-0.010416666666666666 * Float64(Float64(cos(x) + -1.0) * Float64(sqrt(2.0) * (x ^ 2.0))))) end
function tmp = code(x, y) tmp = 0.3333333333333333 + (-0.010416666666666666 * ((cos(x) + -1.0) * (sqrt(2.0) * (x ^ 2.0)))); end
code[x_, y_] := N[(0.3333333333333333 + N[(-0.010416666666666666 * N[(N[(N[Cos[x], $MachinePrecision] + -1.0), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.3333333333333333 + -0.010416666666666666 \cdot \left(\left(\cos x + -1\right) \cdot \left(\sqrt{2} \cdot {x}^{2}\right)\right)
\end{array}
Initial program 99.3%
Simplified99.3%
Taylor expanded in y around 0 62.9%
distribute-lft-out62.9%
sub-neg62.9%
metadata-eval62.9%
Simplified62.9%
Taylor expanded in x around 0 42.2%
Taylor expanded in y around 0 42.3%
distribute-rgt-in42.3%
metadata-eval42.3%
*-commutative42.3%
associate-*l*42.3%
associate-*r*42.3%
*-commutative42.3%
sub-neg42.3%
metadata-eval42.3%
metadata-eval42.3%
Simplified42.3%
Taylor expanded in x around 0 33.3%
Final simplification33.3%
(FPCore (x y) :precision binary64 (+ 0.3333333333333333 (* -0.010416666666666666 (* (sqrt 2.0) (* -0.5 (pow x 4.0))))))
double code(double x, double y) {
return 0.3333333333333333 + (-0.010416666666666666 * (sqrt(2.0) * (-0.5 * pow(x, 4.0))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.3333333333333333d0 + ((-0.010416666666666666d0) * (sqrt(2.0d0) * ((-0.5d0) * (x ** 4.0d0))))
end function
public static double code(double x, double y) {
return 0.3333333333333333 + (-0.010416666666666666 * (Math.sqrt(2.0) * (-0.5 * Math.pow(x, 4.0))));
}
def code(x, y): return 0.3333333333333333 + (-0.010416666666666666 * (math.sqrt(2.0) * (-0.5 * math.pow(x, 4.0))))
function code(x, y) return Float64(0.3333333333333333 + Float64(-0.010416666666666666 * Float64(sqrt(2.0) * Float64(-0.5 * (x ^ 4.0))))) end
function tmp = code(x, y) tmp = 0.3333333333333333 + (-0.010416666666666666 * (sqrt(2.0) * (-0.5 * (x ^ 4.0)))); end
code[x_, y_] := N[(0.3333333333333333 + N[(-0.010416666666666666 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-0.5 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.3333333333333333 + -0.010416666666666666 \cdot \left(\sqrt{2} \cdot \left(-0.5 \cdot {x}^{4}\right)\right)
\end{array}
Initial program 99.3%
Simplified99.3%
Taylor expanded in y around 0 62.9%
distribute-lft-out62.9%
sub-neg62.9%
metadata-eval62.9%
Simplified62.9%
Taylor expanded in x around 0 42.2%
Taylor expanded in y around 0 42.3%
distribute-rgt-in42.3%
metadata-eval42.3%
*-commutative42.3%
associate-*l*42.3%
associate-*r*42.3%
*-commutative42.3%
sub-neg42.3%
metadata-eval42.3%
metadata-eval42.3%
Simplified42.3%
Taylor expanded in x around 0 33.0%
associate-*r*33.0%
Simplified33.0%
Final simplification33.0%
herbie shell --seed 2024115
(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))))))