?

Average Error: 13.4 → 0.6
Time: 32.9s
Precision: binary32
Cost: 17024

?

\[\left(\left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right) \land \left(2.328306437 \cdot 10^{-10} \leq uy \land uy \leq 1\right)\right) \land \left(0 \leq maxCos \land maxCos \leq 1\right)\]
\[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
\[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \left(2 \cdot maxCos + \left(-1 - {maxCos}^{2}\right)\right) \cdot {ux}^{2}} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (*
  (sin (* (* uy 2.0) PI))
  (sqrt
   (- 1.0 (* (+ (- 1.0 ux) (* ux maxCos)) (+ (- 1.0 ux) (* ux maxCos)))))))
(FPCore (ux uy maxCos)
 :precision binary32
 (*
  (sin (* (* uy 2.0) PI))
  (sqrt
   (+
    (* (+ maxCos (- (* -1.0 (+ (* maxCos 2.0) (- maxCos 3.0))) 1.0)) ux)
    (* (+ (* 2.0 maxCos) (- -1.0 (pow maxCos 2.0))) (pow ux 2.0))))))
float code(float ux, float uy, float maxCos) {
	return sinf(((uy * 2.0f) * ((float) M_PI))) * sqrtf((1.0f - (((1.0f - ux) + (ux * maxCos)) * ((1.0f - ux) + (ux * maxCos)))));
}
float code(float ux, float uy, float maxCos) {
	return sinf(((uy * 2.0f) * ((float) M_PI))) * sqrtf((((maxCos + ((-1.0f * ((maxCos * 2.0f) + (maxCos - 3.0f))) - 1.0f)) * ux) + (((2.0f * maxCos) + (-1.0f - powf(maxCos, 2.0f))) * powf(ux, 2.0f))));
}
function code(ux, uy, maxCos)
	return Float32(sin(Float32(Float32(uy * Float32(2.0)) * Float32(pi))) * sqrt(Float32(Float32(1.0) - Float32(Float32(Float32(Float32(1.0) - ux) + Float32(ux * maxCos)) * Float32(Float32(Float32(1.0) - ux) + Float32(ux * maxCos))))))
end
function code(ux, uy, maxCos)
	return Float32(sin(Float32(Float32(uy * Float32(2.0)) * Float32(pi))) * sqrt(Float32(Float32(Float32(maxCos + Float32(Float32(Float32(-1.0) * Float32(Float32(maxCos * Float32(2.0)) + Float32(maxCos - Float32(3.0)))) - Float32(1.0))) * ux) + Float32(Float32(Float32(Float32(2.0) * maxCos) + Float32(Float32(-1.0) - (maxCos ^ Float32(2.0)))) * (ux ^ Float32(2.0))))))
end
function tmp = code(ux, uy, maxCos)
	tmp = sin(((uy * single(2.0)) * single(pi))) * sqrt((single(1.0) - (((single(1.0) - ux) + (ux * maxCos)) * ((single(1.0) - ux) + (ux * maxCos)))));
end
function tmp = code(ux, uy, maxCos)
	tmp = sin(((uy * single(2.0)) * single(pi))) * sqrt((((maxCos + ((single(-1.0) * ((maxCos * single(2.0)) + (maxCos - single(3.0)))) - single(1.0))) * ux) + (((single(2.0) * maxCos) + (single(-1.0) - (maxCos ^ single(2.0)))) * (ux ^ single(2.0)))));
end
\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}
\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \left(2 \cdot maxCos + \left(-1 - {maxCos}^{2}\right)\right) \cdot {ux}^{2}}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 13.4

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Applied egg-rr13.6

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \color{blue}{\frac{\frac{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}}{\frac{-1}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}}}} \]
  3. Simplified14.1

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \color{blue}{\frac{\left(\left(1 - ux\right) + maxCos \cdot ux\right) \cdot \left(\left(1 - ux\right) + maxCos \cdot ux\right)}{\left(\left(\left(1 - ux\right) + maxCos \cdot ux\right) \cdot \left(-\left(\left(1 - ux\right) + maxCos \cdot ux\right)\right)\right) \cdot \frac{\frac{-1}{\left(1 - ux\right) + maxCos \cdot ux}}{\left(1 - ux\right) + maxCos \cdot ux}}}} \]
    Proof

    [Start]13.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \frac{\frac{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}}{\frac{-1}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}}} \]

    rational.json-simplify-47 [=>]13.5

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \color{blue}{\frac{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}{\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \frac{-1}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}}}} \]

    rational.json-simplify-2 [=>]13.5

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \frac{\left(\left(1 - ux\right) + \color{blue}{maxCos \cdot ux}\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}{\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \frac{-1}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}}} \]

    rational.json-simplify-2 [=>]13.5

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \frac{\left(\left(1 - ux\right) + maxCos \cdot ux\right) \cdot \left(\left(1 - ux\right) + \color{blue}{maxCos \cdot ux}\right)}{\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \frac{-1}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}}} \]

    rational.json-simplify-2 [=>]13.5

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \frac{\left(\left(1 - ux\right) + maxCos \cdot ux\right) \cdot \left(\left(1 - ux\right) + maxCos \cdot ux\right)}{\left(\left(\left(1 - ux\right) + \color{blue}{maxCos \cdot ux}\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \frac{-1}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}}} \]

    rational.json-simplify-2 [=>]13.5

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \frac{\left(\left(1 - ux\right) + maxCos \cdot ux\right) \cdot \left(\left(1 - ux\right) + maxCos \cdot ux\right)}{\left(\left(\left(1 - ux\right) + maxCos \cdot ux\right) \cdot \left(-\left(\left(1 - ux\right) + \color{blue}{maxCos \cdot ux}\right)\right)\right) \cdot \frac{-1}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}}} \]

    rational.json-simplify-46 [=>]14.1

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \frac{\left(\left(1 - ux\right) + maxCos \cdot ux\right) \cdot \left(\left(1 - ux\right) + maxCos \cdot ux\right)}{\left(\left(\left(1 - ux\right) + maxCos \cdot ux\right) \cdot \left(-\left(\left(1 - ux\right) + maxCos \cdot ux\right)\right)\right) \cdot \color{blue}{\frac{\frac{-1}{\left(1 - ux\right) + ux \cdot maxCos}}{\left(1 - ux\right) + ux \cdot maxCos}}}} \]

    rational.json-simplify-2 [=>]14.1

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \frac{\left(\left(1 - ux\right) + maxCos \cdot ux\right) \cdot \left(\left(1 - ux\right) + maxCos \cdot ux\right)}{\left(\left(\left(1 - ux\right) + maxCos \cdot ux\right) \cdot \left(-\left(\left(1 - ux\right) + maxCos \cdot ux\right)\right)\right) \cdot \frac{\frac{-1}{\left(1 - ux\right) + \color{blue}{maxCos \cdot ux}}}{\left(1 - ux\right) + ux \cdot maxCos}}} \]

    rational.json-simplify-2 [=>]14.1

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \frac{\left(\left(1 - ux\right) + maxCos \cdot ux\right) \cdot \left(\left(1 - ux\right) + maxCos \cdot ux\right)}{\left(\left(\left(1 - ux\right) + maxCos \cdot ux\right) \cdot \left(-\left(\left(1 - ux\right) + maxCos \cdot ux\right)\right)\right) \cdot \frac{\frac{-1}{\left(1 - ux\right) + maxCos \cdot ux}}{\left(1 - ux\right) + \color{blue}{maxCos \cdot ux}}}} \]
  4. Taylor expanded in ux around 0 0.6

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(-1 \cdot \left({\left(maxCos - 1\right)}^{2} + \left(maxCos - 1\right) \cdot \left(2 \cdot maxCos - 2\right)\right) - -1 \cdot \left(\left(1 - maxCos\right) \cdot \left(\left(-1 \cdot \left(\left(maxCos + 2 \cdot maxCos\right) - 3\right) + maxCos\right) - 1\right)\right)\right) \cdot {ux}^{2} + \left(\left(-1 \cdot \left(\left(maxCos + 2 \cdot maxCos\right) - 3\right) + maxCos\right) - 1\right) \cdot ux}} \]
  5. Simplified0.6

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \left(-1 \cdot \left({\left(maxCos + -1\right)}^{2} + \left(maxCos + -1\right) \cdot \left(maxCos \cdot 2 - 2\right)\right) - -1 \cdot \left(\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot \left(1 - maxCos\right)\right)\right) \cdot {ux}^{2}}} \]
    Proof

    [Start]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(-1 \cdot \left({\left(maxCos - 1\right)}^{2} + \left(maxCos - 1\right) \cdot \left(2 \cdot maxCos - 2\right)\right) - -1 \cdot \left(\left(1 - maxCos\right) \cdot \left(\left(-1 \cdot \left(\left(maxCos + 2 \cdot maxCos\right) - 3\right) + maxCos\right) - 1\right)\right)\right) \cdot {ux}^{2} + \left(\left(-1 \cdot \left(\left(maxCos + 2 \cdot maxCos\right) - 3\right) + maxCos\right) - 1\right) \cdot ux} \]

    rational.json-simplify-1 [=>]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(-1 \cdot \left(\left(maxCos + 2 \cdot maxCos\right) - 3\right) + maxCos\right) - 1\right) \cdot ux + \left(-1 \cdot \left({\left(maxCos - 1\right)}^{2} + \left(maxCos - 1\right) \cdot \left(2 \cdot maxCos - 2\right)\right) - -1 \cdot \left(\left(1 - maxCos\right) \cdot \left(\left(-1 \cdot \left(\left(maxCos + 2 \cdot maxCos\right) - 3\right) + maxCos\right) - 1\right)\right)\right) \cdot {ux}^{2}}} \]

    rational.json-simplify-48 [=>]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(maxCos + \left(-1 \cdot \left(\left(maxCos + 2 \cdot maxCos\right) - 3\right) - 1\right)\right)} \cdot ux + \left(-1 \cdot \left({\left(maxCos - 1\right)}^{2} + \left(maxCos - 1\right) \cdot \left(2 \cdot maxCos - 2\right)\right) - -1 \cdot \left(\left(1 - maxCos\right) \cdot \left(\left(-1 \cdot \left(\left(maxCos + 2 \cdot maxCos\right) - 3\right) + maxCos\right) - 1\right)\right)\right) \cdot {ux}^{2}} \]

    rational.json-simplify-48 [=>]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \color{blue}{\left(2 \cdot maxCos + \left(maxCos - 3\right)\right)} - 1\right)\right) \cdot ux + \left(-1 \cdot \left({\left(maxCos - 1\right)}^{2} + \left(maxCos - 1\right) \cdot \left(2 \cdot maxCos - 2\right)\right) - -1 \cdot \left(\left(1 - maxCos\right) \cdot \left(\left(-1 \cdot \left(\left(maxCos + 2 \cdot maxCos\right) - 3\right) + maxCos\right) - 1\right)\right)\right) \cdot {ux}^{2}} \]

    rational.json-simplify-2 [=>]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(\color{blue}{maxCos \cdot 2} + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \left(-1 \cdot \left({\left(maxCos - 1\right)}^{2} + \left(maxCos - 1\right) \cdot \left(2 \cdot maxCos - 2\right)\right) - -1 \cdot \left(\left(1 - maxCos\right) \cdot \left(\left(-1 \cdot \left(\left(maxCos + 2 \cdot maxCos\right) - 3\right) + maxCos\right) - 1\right)\right)\right) \cdot {ux}^{2}} \]
  6. Taylor expanded in maxCos around 0 0.6

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \color{blue}{\left(\left(2 \cdot maxCos + -1 \cdot {maxCos}^{2}\right) - 1\right)} \cdot {ux}^{2}} \]
  7. Simplified0.6

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \color{blue}{\left(2 \cdot maxCos + \left(-1 - {maxCos}^{2}\right)\right)} \cdot {ux}^{2}} \]
    Proof

    [Start]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \left(\left(2 \cdot maxCos + -1 \cdot {maxCos}^{2}\right) - 1\right) \cdot {ux}^{2}} \]

    rational.json-simplify-1 [=>]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \left(\color{blue}{\left(-1 \cdot {maxCos}^{2} + 2 \cdot maxCos\right)} - 1\right) \cdot {ux}^{2}} \]

    rational.json-simplify-48 [=>]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \color{blue}{\left(2 \cdot maxCos + \left(-1 \cdot {maxCos}^{2} - 1\right)\right)} \cdot {ux}^{2}} \]

    rational.json-simplify-2 [=>]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \left(2 \cdot maxCos + \left(\color{blue}{{maxCos}^{2} \cdot -1} - 1\right)\right) \cdot {ux}^{2}} \]

    rational.json-simplify-9 [=>]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \left(2 \cdot maxCos + \left(\color{blue}{\left(-{maxCos}^{2}\right)} - 1\right)\right) \cdot {ux}^{2}} \]

    rational.json-simplify-12 [=>]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \left(2 \cdot maxCos + \left(\color{blue}{\left(0 - {maxCos}^{2}\right)} - 1\right)\right) \cdot {ux}^{2}} \]

    rational.json-simplify-42 [=>]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \left(2 \cdot maxCos + \color{blue}{\left(\left(0 - 1\right) - {maxCos}^{2}\right)}\right) \cdot {ux}^{2}} \]

    metadata-eval [=>]0.6

    \[ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \left(2 \cdot maxCos + \left(\color{blue}{-1} - {maxCos}^{2}\right)\right) \cdot {ux}^{2}} \]
  8. Final simplification0.6

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos + \left(-1 \cdot \left(maxCos \cdot 2 + \left(maxCos - 3\right)\right) - 1\right)\right) \cdot ux + \left(2 \cdot maxCos + \left(-1 - {maxCos}^{2}\right)\right) \cdot {ux}^{2}} \]

Alternatives

Alternative 1
Error2.6
Cost30984
\[\begin{array}{l} t_0 := \left(1 - ux\right) + ux \cdot maxCos\\ t_1 := \sin \left(\left(uy \cdot 2\right) \cdot \pi\right)\\ t_2 := t_1 \cdot \sqrt{1 - t_0 \cdot t_0}\\ \mathbf{if}\;t_2 \leq 0:\\ \;\;\;\;t_1 \cdot \sqrt{2 \cdot ux + maxCos \cdot \left(ux \cdot -2\right)}\\ \mathbf{elif}\;t_2 \leq 0.00022499999613501132:\\ \;\;\;\;2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(2 - 2 \cdot maxCos\right) \cdot ux - {\left(ux \cdot \left(maxCos + -1\right)\right)}^{2}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error3.1
Cost23336
\[\begin{array}{l} t_0 := \sin \left(\left(uy \cdot 2\right) \cdot \pi\right)\\ \mathbf{if}\;t_0 \leq -0.20000000298023224:\\ \;\;\;\;t_0 \cdot \sqrt{\left(maxCos + \left(-1 - \left(maxCos + \left(maxCos + \left(maxCos + -3\right)\right)\right)\right)\right) \cdot ux}\\ \mathbf{elif}\;t_0 \leq 0.008999999612569809:\\ \;\;\;\;2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(2 - 2 \cdot maxCos\right) \cdot ux - {\left(ux \cdot \left(maxCos + -1\right)\right)}^{2}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \sqrt{2 \cdot ux + maxCos \cdot \left(ux \cdot -2\right)}\\ \end{array} \]
Alternative 3
Error3.1
Cost23336
\[\begin{array}{l} t_0 := \sin \left(\left(uy \cdot 2\right) \cdot \pi\right)\\ \mathbf{if}\;t_0 \leq -0.20000000298023224:\\ \;\;\;\;t_0 \cdot \sqrt{\left(maxCos + \left(-1 - \left(maxCos + \left(maxCos + \left(maxCos + -3\right)\right)\right)\right)\right) \cdot ux}\\ \mathbf{elif}\;t_0 \leq 0.008999999612569809:\\ \;\;\;\;\left(uy \cdot \pi\right) \cdot \left(\sqrt{\left(2 - 2 \cdot maxCos\right) \cdot ux - {\left(ux \cdot \left(maxCos + -1\right)\right)}^{2}} \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \sqrt{2 \cdot ux + maxCos \cdot \left(ux \cdot -2\right)}\\ \end{array} \]
Alternative 4
Error3.4
Cost23208
\[\begin{array}{l} t_0 := \sin \left(\left(uy \cdot 2\right) \cdot \pi\right)\\ t_1 := \left(2 - 2 \cdot maxCos\right) \cdot ux\\ \mathbf{if}\;t_0 \leq -0.20000000298023224:\\ \;\;\;\;t_0 \cdot \sqrt{t_1}\\ \mathbf{elif}\;t_0 \leq 0.008999999612569809:\\ \;\;\;\;\left(uy \cdot \pi\right) \cdot \left(\sqrt{t_1 - {ux}^{2}} \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \sqrt{2 \cdot ux + maxCos \cdot \left(ux \cdot -2\right)}\\ \end{array} \]
Alternative 5
Error3.4
Cost23208
\[\begin{array}{l} t_0 := \sin \left(\left(uy \cdot 2\right) \cdot \pi\right)\\ t_1 := \left(2 - 2 \cdot maxCos\right) \cdot ux\\ \mathbf{if}\;t_0 \leq -0.20000000298023224:\\ \;\;\;\;\sin \left(\left(1 - \pi \cdot \left(-\left(uy + uy\right)\right)\right) + -1\right) \cdot \sqrt{t_1}\\ \mathbf{elif}\;t_0 \leq 0.008999999612569809:\\ \;\;\;\;\left(uy \cdot \pi\right) \cdot \left(\sqrt{t_1 - {ux}^{2}} \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \sqrt{2 \cdot ux + maxCos \cdot \left(ux \cdot -2\right)}\\ \end{array} \]
Alternative 6
Error3.4
Cost23208
\[\begin{array}{l} t_0 := \sin \left(\left(uy \cdot 2\right) \cdot \pi\right)\\ \mathbf{if}\;t_0 \leq -0.20000000298023224:\\ \;\;\;\;t_0 \cdot \sqrt{\left(maxCos + \left(-1 - \left(maxCos + \left(maxCos + \left(maxCos + -3\right)\right)\right)\right)\right) \cdot ux}\\ \mathbf{elif}\;t_0 \leq 0.008999999612569809:\\ \;\;\;\;\left(uy \cdot \pi\right) \cdot \left(\sqrt{\left(2 - 2 \cdot maxCos\right) \cdot ux - {ux}^{2}} \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \sqrt{2 \cdot ux + maxCos \cdot \left(ux \cdot -2\right)}\\ \end{array} \]
Alternative 7
Error4.3
Cost23176
\[\begin{array}{l} t_0 := \sin \left(\left(uy \cdot 2\right) \cdot \pi\right)\\ \mathbf{if}\;t_0 \leq -0.20000000298023224:\\ \;\;\;\;t_0 \cdot \sqrt{\left(2 - 2 \cdot maxCos\right) \cdot ux}\\ \mathbf{elif}\;t_0 \leq 0.008999999612569809:\\ \;\;\;\;2 \cdot \left(\pi \cdot \left(uy \cdot \sqrt{2 \cdot ux - {ux}^{2}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \sqrt{2 \cdot ux + maxCos \cdot \left(ux \cdot -2\right)}\\ \end{array} \]
Alternative 8
Error0.5
Cost16960
\[\sqrt{\left(maxCos + \left(-1 - \left(maxCos + \left(2 \cdot maxCos - 3\right)\right)\right)\right) \cdot ux + {ux}^{2} \cdot \left(-1 - \left({maxCos}^{2} - 2 \cdot maxCos\right)\right)} \cdot \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \]
Alternative 9
Error0.5
Cost13408
\[\sqrt{\left(2 - \left(maxCos + maxCos\right)\right) \cdot ux - {\left(ux \cdot \left(maxCos + -1\right)\right)}^{2}} \cdot \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \]
Alternative 10
Error1.4
Cost13220
\[\begin{array}{l} \mathbf{if}\;maxCos \leq 0.00011500000255182385:\\ \;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{ux + \left(ux - {ux}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(2 - 2 \cdot maxCos\right) \cdot ux - {\left(ux \cdot \left(maxCos + -1\right)\right)}^{2}}\right)\right)\\ \end{array} \]
Alternative 11
Error1.4
Cost13220
\[\begin{array}{l} \mathbf{if}\;maxCos \leq 0.00011500000255182385:\\ \;\;\;\;\sqrt{2 \cdot ux - {ux}^{2}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(2 - 2 \cdot maxCos\right) \cdot ux - {\left(ux \cdot \left(maxCos + -1\right)\right)}^{2}}\right)\right)\\ \end{array} \]
Alternative 12
Error4.2
Cost10116
\[\begin{array}{l} \mathbf{if}\;uy \cdot 2 \leq 0.003000000026077032:\\ \;\;\;\;2 \cdot \left(\pi \cdot \left(uy \cdot \sqrt{2 \cdot ux - {ux}^{2}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(2 - 2 \cdot maxCos\right) \cdot ux}\\ \end{array} \]
Alternative 13
Error4.5
Cost10084
\[\begin{array}{l} \mathbf{if}\;uy \cdot 2 \leq 0.003000000026077032:\\ \;\;\;\;2 \cdot \left(\pi \cdot \left(uy \cdot \sqrt{2 \cdot ux - {ux}^{2}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{ux + ux}\\ \end{array} \]
Alternative 14
Error8.6
Cost9856
\[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{ux + ux} \]
Alternative 15
Error11.0
Cost6784
\[2 \cdot \left(\pi \cdot \left(uy \cdot \sqrt{ux \cdot \left(2 - \left(maxCos + maxCos\right)\right)}\right)\right) \]
Alternative 16
Error11.8
Cost6656
\[2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{ux + ux}\right) \]

Error

Reproduce?

herbie shell --seed 2023074 
(FPCore (ux uy maxCos)
  :name "UniformSampleCone, y"
  :precision binary32
  :pre (and (and (and (<= 2.328306437e-10 ux) (<= ux 1.0)) (and (<= 2.328306437e-10 uy) (<= uy 1.0))) (and (<= 0.0 maxCos) (<= maxCos 1.0)))
  (* (sin (* (* uy 2.0) PI)) (sqrt (- 1.0 (* (+ (- 1.0 ux) (* ux maxCos)) (+ (- 1.0 ux) (* ux maxCos)))))))