Average Error: 13.5 → 0.5
Time: 25.3s
Precision: binary32
Cost: 29408
\[\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)} \]
\[\sqrt[3]{\left({ux}^{1.5} \cdot {\left(-\mathsf{fma}\left(ux, {\left(maxCos + -1\right)}^{2}, \mathsf{fma}\left(maxCos, 2, -2\right)\right)\right)}^{1.5}\right) \cdot {\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}^{3}} \]
(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
 (cbrt
  (*
   (*
    (pow ux 1.5)
    (pow (- (fma ux (pow (+ maxCos -1.0) 2.0) (fma maxCos 2.0 -2.0))) 1.5))
   (pow (sin (* uy (* 2.0 PI))) 3.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 cbrtf(((powf(ux, 1.5f) * powf(-fmaf(ux, powf((maxCos + -1.0f), 2.0f), fmaf(maxCos, 2.0f, -2.0f)), 1.5f)) * powf(sinf((uy * (2.0f * ((float) M_PI)))), 3.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 cbrt(Float32(Float32((ux ^ Float32(1.5)) * (Float32(-fma(ux, (Float32(maxCos + Float32(-1.0)) ^ Float32(2.0)), fma(maxCos, Float32(2.0), Float32(-2.0)))) ^ Float32(1.5))) * (sin(Float32(uy * Float32(Float32(2.0) * Float32(pi)))) ^ Float32(3.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)}
\sqrt[3]{\left({ux}^{1.5} \cdot {\left(-\mathsf{fma}\left(ux, {\left(maxCos + -1\right)}^{2}, \mathsf{fma}\left(maxCos, 2, -2\right)\right)\right)}^{1.5}\right) \cdot {\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}^{3}}

Error

Derivation

  1. Initial program 13.5

    \[\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 \color{blue}{\sqrt[3]{{\left(1 - {\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux\right)}^{2}\right)}^{1.5} \cdot {\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}^{3}}} \]
  3. Taylor expanded in ux around 0 0.5

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

    \[\leadsto \sqrt[3]{{\color{blue}{\left(-ux \cdot \mathsf{fma}\left(ux, {\left(maxCos + -1\right)}^{2}, \mathsf{fma}\left(2, maxCos, -2\right)\right)\right)}}^{1.5} \cdot {\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}^{3}} \]
    Proof
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (+.f32 maxCos -1) 2) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (+.f32 maxCos (Rewrite<= metadata-eval (neg.f32 1))) 2) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (Rewrite<= sub-neg_binary32 (-.f32 maxCos 1)) 2) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (Rewrite=> unpow2_binary32 (*.f32 (-.f32 maxCos 1) (-.f32 maxCos 1))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (Rewrite<= sqr-neg_binary32 (*.f32 (neg.f32 (-.f32 maxCos 1)) (neg.f32 (-.f32 maxCos 1)))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (*.f32 (Rewrite<= mul-1-neg_binary32 (*.f32 -1 (-.f32 maxCos 1))) (neg.f32 (-.f32 maxCos 1))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (*.f32 (*.f32 -1 (-.f32 maxCos 1)) (Rewrite<= mul-1-neg_binary32 (*.f32 -1 (-.f32 maxCos 1)))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (*.f32 (*.f32 -1 (Rewrite=> sub-neg_binary32 (+.f32 maxCos (neg.f32 1)))) (*.f32 -1 (-.f32 maxCos 1))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (*.f32 (*.f32 -1 (+.f32 maxCos (Rewrite=> metadata-eval -1))) (*.f32 -1 (-.f32 maxCos 1))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (*.f32 (*.f32 -1 (Rewrite=> +-commutative_binary32 (+.f32 -1 maxCos))) (*.f32 -1 (-.f32 maxCos 1))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (*.f32 (Rewrite=> distribute-lft-in_binary32 (+.f32 (*.f32 -1 -1) (*.f32 -1 maxCos))) (*.f32 -1 (-.f32 maxCos 1))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (*.f32 (+.f32 (Rewrite=> metadata-eval 1) (*.f32 -1 maxCos)) (*.f32 -1 (-.f32 maxCos 1))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (*.f32 (+.f32 1 (*.f32 -1 maxCos)) (*.f32 -1 (Rewrite=> sub-neg_binary32 (+.f32 maxCos (neg.f32 1))))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (*.f32 (+.f32 1 (*.f32 -1 maxCos)) (*.f32 -1 (+.f32 maxCos (Rewrite=> metadata-eval -1)))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (*.f32 (+.f32 1 (*.f32 -1 maxCos)) (*.f32 -1 (Rewrite=> +-commutative_binary32 (+.f32 -1 maxCos)))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (*.f32 (+.f32 1 (*.f32 -1 maxCos)) (Rewrite=> distribute-lft-in_binary32 (+.f32 (*.f32 -1 -1) (*.f32 -1 maxCos)))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (*.f32 (+.f32 1 (*.f32 -1 maxCos)) (+.f32 (Rewrite=> metadata-eval 1) (*.f32 -1 maxCos))) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (Rewrite<= unpow2_binary32 (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)) (fma.f32 2 maxCos -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2) (Rewrite=> fma-udef_binary32 (+.f32 (*.f32 2 maxCos) -2))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2) (+.f32 (*.f32 (Rewrite<= metadata-eval (*.f32 -1 -2)) maxCos) -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2) (+.f32 (Rewrite<= associate-*r*_binary32 (*.f32 -1 (*.f32 -2 maxCos))) -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2) (+.f32 (Rewrite=> *-commutative_binary32 (*.f32 (*.f32 -2 maxCos) -1)) -2)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2) (+.f32 (*.f32 (*.f32 -2 maxCos) -1) (Rewrite<= metadata-eval (*.f32 2 -1)))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2) (Rewrite<= distribute-rgt-in_binary32 (*.f32 -1 (+.f32 (*.f32 -2 maxCos) 2)))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2) (*.f32 -1 (Rewrite=> +-commutative_binary32 (+.f32 2 (*.f32 -2 maxCos))))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2) (*.f32 -1 (+.f32 2 (*.f32 (Rewrite<= metadata-eval (neg.f32 2)) maxCos)))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2) (*.f32 -1 (Rewrite<= cancel-sign-sub-inv_binary32 (-.f32 2 (*.f32 2 maxCos))))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (fma.f32 ux (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2) (Rewrite=> mul-1-neg_binary32 (neg.f32 (-.f32 2 (*.f32 2 maxCos))))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (*.f32 ux (Rewrite<= fma-neg_binary32 (-.f32 (*.f32 ux (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)) (-.f32 2 (*.f32 2 maxCos)))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (Rewrite<= distribute-lft-out--_binary32 (-.f32 (*.f32 ux (*.f32 ux (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2))) (*.f32 ux (-.f32 2 (*.f32 2 maxCos)))))): 19 points increase in error, 18 points decrease in error
    (neg.f32 (-.f32 (Rewrite<= associate-*l*_binary32 (*.f32 (*.f32 ux ux) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2))) (*.f32 ux (-.f32 2 (*.f32 2 maxCos))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (-.f32 (*.f32 (Rewrite<= unpow2_binary32 (pow.f32 ux 2)) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)) (*.f32 ux (-.f32 2 (*.f32 2 maxCos))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (-.f32 (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)) (*.f32 ux (Rewrite=> cancel-sign-sub-inv_binary32 (+.f32 2 (*.f32 (neg.f32 2) maxCos)))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (-.f32 (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)) (*.f32 ux (+.f32 2 (*.f32 (Rewrite=> metadata-eval -2) maxCos))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (-.f32 (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)) (*.f32 ux (Rewrite<= +-commutative_binary32 (+.f32 (*.f32 -2 maxCos) 2))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (-.f32 (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)) (Rewrite<= *-commutative_binary32 (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (Rewrite<= unsub-neg_binary32 (+.f32 (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)) (neg.f32 (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (+.f32 (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)) (Rewrite<= mul-1-neg_binary32 (*.f32 -1 (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux))))): 0 points increase in error, 0 points decrease in error
    (neg.f32 (Rewrite<= +-commutative_binary32 (+.f32 (*.f32 -1 (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)) (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2))))): 0 points increase in error, 0 points decrease in error
    (Rewrite<= sub0-neg_binary32 (-.f32 0 (+.f32 (*.f32 -1 (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)) (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2))))): 0 points increase in error, 0 points decrease in error
    (-.f32 0 (Rewrite=> +-commutative_binary32 (+.f32 (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)) (*.f32 -1 (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux))))): 0 points increase in error, 0 points decrease in error
    (-.f32 0 (+.f32 (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)) (Rewrite=> mul-1-neg_binary32 (neg.f32 (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux))))): 0 points increase in error, 0 points decrease in error
    (-.f32 0 (Rewrite=> unsub-neg_binary32 (-.f32 (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)))): 0 points increase in error, 0 points decrease in error
    (Rewrite<= associate-+l-_binary32 (+.f32 (-.f32 0 (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux))): 0 points increase in error, 0 points decrease in error
    (+.f32 (Rewrite<= neg-sub0_binary32 (neg.f32 (*.f32 (pow.f32 ux 2) (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2)))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (neg.f32 (Rewrite=> *-commutative_binary32 (*.f32 (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2) (pow.f32 ux 2)))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (Rewrite=> distribute-rgt-neg-in_binary32 (*.f32 (pow.f32 (+.f32 1 (*.f32 -1 maxCos)) 2) (neg.f32 (pow.f32 ux 2)))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (Rewrite=> unpow2_binary32 (*.f32 (+.f32 1 (*.f32 -1 maxCos)) (+.f32 1 (*.f32 -1 maxCos)))) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (*.f32 (Rewrite=> +-commutative_binary32 (+.f32 (*.f32 -1 maxCos) 1)) (+.f32 1 (*.f32 -1 maxCos))) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (*.f32 (+.f32 (Rewrite=> mul-1-neg_binary32 (neg.f32 maxCos)) 1) (+.f32 1 (*.f32 -1 maxCos))) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (*.f32 (+.f32 (Rewrite=> neg-sub0_binary32 (-.f32 0 maxCos)) 1) (+.f32 1 (*.f32 -1 maxCos))) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (*.f32 (Rewrite=> associate-+l-_binary32 (-.f32 0 (-.f32 maxCos 1))) (+.f32 1 (*.f32 -1 maxCos))) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (*.f32 (Rewrite<= neg-sub0_binary32 (neg.f32 (-.f32 maxCos 1))) (+.f32 1 (*.f32 -1 maxCos))) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (*.f32 (neg.f32 (-.f32 maxCos 1)) (Rewrite=> +-commutative_binary32 (+.f32 (*.f32 -1 maxCos) 1))) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (*.f32 (neg.f32 (-.f32 maxCos 1)) (+.f32 (Rewrite=> mul-1-neg_binary32 (neg.f32 maxCos)) 1)) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (*.f32 (neg.f32 (-.f32 maxCos 1)) (+.f32 (Rewrite=> neg-sub0_binary32 (-.f32 0 maxCos)) 1)) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (*.f32 (neg.f32 (-.f32 maxCos 1)) (Rewrite=> associate-+l-_binary32 (-.f32 0 (-.f32 maxCos 1)))) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (*.f32 (neg.f32 (-.f32 maxCos 1)) (Rewrite<= neg-sub0_binary32 (neg.f32 (-.f32 maxCos 1)))) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (Rewrite=> sqr-neg_binary32 (*.f32 (-.f32 maxCos 1) (-.f32 maxCos 1))) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (Rewrite<= unpow2_binary32 (pow.f32 (-.f32 maxCos 1) 2)) (neg.f32 (pow.f32 ux 2))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (Rewrite<= distribute-rgt-neg-in_binary32 (neg.f32 (*.f32 (pow.f32 (-.f32 maxCos 1) 2) (pow.f32 ux 2)))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (+.f32 (Rewrite<= mul-1-neg_binary32 (*.f32 -1 (*.f32 (pow.f32 (-.f32 maxCos 1) 2) (pow.f32 ux 2)))) (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux)): 0 points increase in error, 0 points decrease in error
    (Rewrite=> +-commutative_binary32 (+.f32 (*.f32 (+.f32 (*.f32 -2 maxCos) 2) ux) (*.f32 -1 (*.f32 (pow.f32 (-.f32 maxCos 1) 2) (pow.f32 ux 2))))): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (Rewrite=> +-commutative_binary32 (+.f32 2 (*.f32 -2 maxCos))) ux) (*.f32 -1 (*.f32 (pow.f32 (-.f32 maxCos 1) 2) (pow.f32 ux 2)))): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (+.f32 2 (*.f32 (Rewrite<= metadata-eval (neg.f32 2)) maxCos)) ux) (*.f32 -1 (*.f32 (pow.f32 (-.f32 maxCos 1) 2) (pow.f32 ux 2)))): 0 points increase in error, 0 points decrease in error
    (+.f32 (*.f32 (Rewrite<= cancel-sign-sub-inv_binary32 (-.f32 2 (*.f32 2 maxCos))) ux) (*.f32 -1 (*.f32 (pow.f32 (-.f32 maxCos 1) 2) (pow.f32 ux 2)))): 0 points increase in error, 0 points decrease in error
  5. Applied egg-rr0.5

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

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

Alternatives

Alternative 1
Error0.5
Cost26176
\[\sqrt[3]{{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}^{3} \cdot {\left(ux \cdot \left(-\mathsf{fma}\left(ux, {\left(maxCos + -1\right)}^{2}, \mathsf{fma}\left(2, maxCos, -2\right)\right)\right)\right)}^{1.5}} \]
Alternative 2
Error0.5
Cost23264
\[\sin \left(\sqrt[3]{{\left(2 \cdot \pi\right)}^{3} \cdot {uy}^{3}}\right) \cdot \sqrt{\left(maxCos + -1\right) \cdot \left({ux}^{2} \cdot \left(1 - maxCos\right)\right) + ux \cdot \left(1 + \left(\left(1 - maxCos\right) - maxCos\right)\right)} \]
Alternative 3
Error0.5
Cost23104
\[\sqrt[3]{{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}^{3} \cdot {\left(ux \cdot \left(2 + maxCos \cdot -2\right) - {\left(maxCos + -1\right)}^{2} \cdot {ux}^{2}\right)}^{1.5}} \]
Alternative 4
Error0.5
Cost10368
\[\sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{\left(maxCos + -1\right) \cdot \left(\left(1 - maxCos\right) \cdot \left(ux \cdot ux\right)\right) + \left(1 - maxCos\right) \cdot \left(ux + ux\right)} \]
Alternative 5
Error0.5
Cost10304
\[\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{ux \cdot \left(ux \cdot \left(\left(maxCos + -1\right) \cdot \left(1 - maxCos\right)\right) + 2 \cdot \left(1 - maxCos\right)\right)} \]
Alternative 6
Error1.4
Cost10052
\[\begin{array}{l} \mathbf{if}\;maxCos \leq 0.00019999999494757503:\\ \;\;\;\;\sqrt{ux - ux \cdot \left(ux + -1\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{ux \cdot \left(ux \cdot \left(\left(maxCos + -1\right) \cdot \left(1 - maxCos\right)\right) + \left(\left(2 - maxCos\right) - maxCos\right)\right)}\right)\\ \end{array} \]
Alternative 7
Error3.4
Cost9988
\[\begin{array}{l} \mathbf{if}\;2 \cdot uy \leq 0.004000000189989805:\\ \;\;\;\;\sqrt{\left(1 - maxCos\right) \cdot \left(ux \cdot 2 - \left(1 - maxCos\right) \cdot \left(ux \cdot ux\right)\right)} \cdot \left(2 \cdot \left(uy \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot 2}\\ \end{array} \]
Alternative 8
Error1.4
Cost9988
\[\begin{array}{l} \mathbf{if}\;maxCos \leq 0.00019999999494757503:\\ \;\;\;\;\sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(2 - ux\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{ux \cdot \left(ux \cdot \left(\left(maxCos + -1\right) \cdot \left(1 - maxCos\right)\right) + \left(\left(2 - maxCos\right) - maxCos\right)\right)}\right)\\ \end{array} \]
Alternative 9
Error6.0
Cost7040
\[\sqrt{\left(1 - maxCos\right) \cdot \left(ux \cdot 2 - \left(1 - maxCos\right) \cdot \left(ux \cdot ux\right)\right)} \cdot \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
Alternative 10
Error7.4
Cost6784
\[uy \cdot \left(\left(2 \cdot \pi\right) \cdot \sqrt{ux - ux \cdot \left(ux + -1\right)}\right) \]
Alternative 11
Error11.8
Cost6656
\[2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{ux \cdot 2}\right) \]

Error

Reproduce

herbie shell --seed 2022294 
(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)))))))