UniformSampleCone 2

Percentage Accurate: 98.9% → 99.0%
Time: 7.2s
Alternatives: 26
Speedup: 1.2×

Specification

?
\[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
\[\begin{array}{l} t_0 := \left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\\ t_1 := \sqrt{1 - t\_0 \cdot t\_0}\\ t_2 := \left(uy \cdot 2\right) \cdot \pi\\ \left(\left(\cos t\_2 \cdot t\_1\right) \cdot xi + \left(\sin t\_2 \cdot t\_1\right) \cdot yi\right) + t\_0 \cdot zi \end{array} \]
(FPCore (xi yi zi ux uy maxCos)
  :precision binary32
  :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                         (and (<= -10000.0 yi) (<= yi 10000.0)))
                    (and (<= -10000.0 zi) (<= zi 10000.0)))
               (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
          (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
     (and (<= 0.0 maxCos) (<= maxCos 1.0)))
  (let* ((t_0 (* (* (- 1.0 ux) maxCos) ux))
       (t_1 (sqrt (- 1.0 (* t_0 t_0))))
       (t_2 (* (* uy 2.0) PI)))
  (+
   (+ (* (* (cos t_2) t_1) xi) (* (* (sin t_2) t_1) yi))
   (* t_0 zi))))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
	float t_0 = ((1.0f - ux) * maxCos) * ux;
	float t_1 = sqrtf((1.0f - (t_0 * t_0)));
	float t_2 = (uy * 2.0f) * ((float) M_PI);
	return (((cosf(t_2) * t_1) * xi) + ((sinf(t_2) * t_1) * yi)) + (t_0 * zi);
}
function code(xi, yi, zi, ux, uy, maxCos)
	t_0 = Float32(Float32(Float32(Float32(1.0) - ux) * maxCos) * ux)
	t_1 = sqrt(Float32(Float32(1.0) - Float32(t_0 * t_0)))
	t_2 = Float32(Float32(uy * Float32(2.0)) * Float32(pi))
	return Float32(Float32(Float32(Float32(cos(t_2) * t_1) * xi) + Float32(Float32(sin(t_2) * t_1) * yi)) + Float32(t_0 * zi))
end
function tmp = code(xi, yi, zi, ux, uy, maxCos)
	t_0 = ((single(1.0) - ux) * maxCos) * ux;
	t_1 = sqrt((single(1.0) - (t_0 * t_0)));
	t_2 = (uy * single(2.0)) * single(pi);
	tmp = (((cos(t_2) * t_1) * xi) + ((sin(t_2) * t_1) * yi)) + (t_0 * zi);
end
\begin{array}{l}
t_0 := \left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\\
t_1 := \sqrt{1 - t\_0 \cdot t\_0}\\
t_2 := \left(uy \cdot 2\right) \cdot \pi\\
\left(\left(\cos t\_2 \cdot t\_1\right) \cdot xi + \left(\sin t\_2 \cdot t\_1\right) \cdot yi\right) + t\_0 \cdot zi
\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 26 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 98.9% accurate, 1.0× speedup?

\[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
\[\begin{array}{l} t_0 := \left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\\ t_1 := \sqrt{1 - t\_0 \cdot t\_0}\\ t_2 := \left(uy \cdot 2\right) \cdot \pi\\ \left(\left(\cos t\_2 \cdot t\_1\right) \cdot xi + \left(\sin t\_2 \cdot t\_1\right) \cdot yi\right) + t\_0 \cdot zi \end{array} \]
(FPCore (xi yi zi ux uy maxCos)
  :precision binary32
  :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                         (and (<= -10000.0 yi) (<= yi 10000.0)))
                    (and (<= -10000.0 zi) (<= zi 10000.0)))
               (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
          (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
     (and (<= 0.0 maxCos) (<= maxCos 1.0)))
  (let* ((t_0 (* (* (- 1.0 ux) maxCos) ux))
       (t_1 (sqrt (- 1.0 (* t_0 t_0))))
       (t_2 (* (* uy 2.0) PI)))
  (+
   (+ (* (* (cos t_2) t_1) xi) (* (* (sin t_2) t_1) yi))
   (* t_0 zi))))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
	float t_0 = ((1.0f - ux) * maxCos) * ux;
	float t_1 = sqrtf((1.0f - (t_0 * t_0)));
	float t_2 = (uy * 2.0f) * ((float) M_PI);
	return (((cosf(t_2) * t_1) * xi) + ((sinf(t_2) * t_1) * yi)) + (t_0 * zi);
}
function code(xi, yi, zi, ux, uy, maxCos)
	t_0 = Float32(Float32(Float32(Float32(1.0) - ux) * maxCos) * ux)
	t_1 = sqrt(Float32(Float32(1.0) - Float32(t_0 * t_0)))
	t_2 = Float32(Float32(uy * Float32(2.0)) * Float32(pi))
	return Float32(Float32(Float32(Float32(cos(t_2) * t_1) * xi) + Float32(Float32(sin(t_2) * t_1) * yi)) + Float32(t_0 * zi))
end
function tmp = code(xi, yi, zi, ux, uy, maxCos)
	t_0 = ((single(1.0) - ux) * maxCos) * ux;
	t_1 = sqrt((single(1.0) - (t_0 * t_0)));
	t_2 = (uy * single(2.0)) * single(pi);
	tmp = (((cos(t_2) * t_1) * xi) + ((sin(t_2) * t_1) * yi)) + (t_0 * zi);
end
\begin{array}{l}
t_0 := \left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\\
t_1 := \sqrt{1 - t\_0 \cdot t\_0}\\
t_2 := \left(uy \cdot 2\right) \cdot \pi\\
\left(\left(\cos t\_2 \cdot t\_1\right) \cdot xi + \left(\sin t\_2 \cdot t\_1\right) \cdot yi\right) + t\_0 \cdot zi
\end{array}

Alternative 1: 99.0% accurate, 1.0× speedup?

\[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
\[\begin{array}{l} t_0 := \left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\\ t_1 := \pi \cdot \left(uy + uy\right)\\ t_2 := \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, t\_0 \cdot ux, 1\right)}\\ \mathsf{fma}\left(yi \cdot t\_2, \sin t\_1, \mathsf{fma}\left(xi \cdot t\_2, \cos t\_1, zi \cdot t\_0\right)\right) \end{array} \]
(FPCore (xi yi zi ux uy maxCos)
  :precision binary32
  :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                         (and (<= -10000.0 yi) (<= yi 10000.0)))
                    (and (<= -10000.0 zi) (<= zi 10000.0)))
               (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
          (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
     (and (<= 0.0 maxCos) (<= maxCos 1.0)))
  (let* ((t_0 (* (* maxCos (- 1.0 ux)) ux))
       (t_1 (* PI (+ uy uy)))
       (t_2 (sqrt (fma (* (- ux 1.0) maxCos) (* t_0 ux) 1.0))))
  (fma (* yi t_2) (sin t_1) (fma (* xi t_2) (cos t_1) (* zi t_0)))))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
	float t_0 = (maxCos * (1.0f - ux)) * ux;
	float t_1 = ((float) M_PI) * (uy + uy);
	float t_2 = sqrtf(fmaf(((ux - 1.0f) * maxCos), (t_0 * ux), 1.0f));
	return fmaf((yi * t_2), sinf(t_1), fmaf((xi * t_2), cosf(t_1), (zi * t_0)));
}
function code(xi, yi, zi, ux, uy, maxCos)
	t_0 = Float32(Float32(maxCos * Float32(Float32(1.0) - ux)) * ux)
	t_1 = Float32(Float32(pi) * Float32(uy + uy))
	t_2 = sqrt(fma(Float32(Float32(ux - Float32(1.0)) * maxCos), Float32(t_0 * ux), Float32(1.0)))
	return fma(Float32(yi * t_2), sin(t_1), fma(Float32(xi * t_2), cos(t_1), Float32(zi * t_0)))
end
\begin{array}{l}
t_0 := \left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\\
t_1 := \pi \cdot \left(uy + uy\right)\\
t_2 := \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, t\_0 \cdot ux, 1\right)}\\
\mathsf{fma}\left(yi \cdot t\_2, \sin t\_1, \mathsf{fma}\left(xi \cdot t\_2, \cos t\_1, zi \cdot t\_0\right)\right)
\end{array}
Derivation
  1. Initial program 98.9%

    \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
  2. Applied rewrites99.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(yi \cdot \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)}, \sin \left(\pi \cdot \left(uy + uy\right)\right), \mathsf{fma}\left(xi \cdot \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)}, \cos \left(\pi \cdot \left(uy + uy\right)\right), zi \cdot \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right)\right)\right)} \]
  3. Add Preprocessing

Alternative 2: 99.0% accurate, 1.2× speedup?

\[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
\[\mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\left(-\mathsf{fma}\left(uy + uy, \pi, 1.5707963705062866\right)\right) + 1.5707963705062866\right) \cdot xi\right)\right) \]
(FPCore (xi yi zi ux uy maxCos)
  :precision binary32
  :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                         (and (<= -10000.0 yi) (<= yi 10000.0)))
                    (and (<= -10000.0 zi) (<= zi 10000.0)))
               (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
          (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
     (and (<= 0.0 maxCos) (<= maxCos 1.0)))
  (fma
 (- 1.0 ux)
 (* (* zi ux) maxCos)
 (*
  (sqrt
   (fma
    (* (- ux 1.0) maxCos)
    (* (* (* maxCos (- 1.0 ux)) ux) ux)
    1.0))
  (fma
   (sin (* PI (+ uy uy)))
   yi
   (*
    (cos
     (+ (- (fma (+ uy uy) PI 1.5707963705062866)) 1.5707963705062866))
    xi)))))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
	return fmaf((1.0f - ux), ((zi * ux) * maxCos), (sqrtf(fmaf(((ux - 1.0f) * maxCos), (((maxCos * (1.0f - ux)) * ux) * ux), 1.0f)) * fmaf(sinf((((float) M_PI) * (uy + uy))), yi, (cosf((-fmaf((uy + uy), ((float) M_PI), 1.5707963705062866f) + 1.5707963705062866f)) * xi))));
}
function code(xi, yi, zi, ux, uy, maxCos)
	return fma(Float32(Float32(1.0) - ux), Float32(Float32(zi * ux) * maxCos), Float32(sqrt(fma(Float32(Float32(ux - Float32(1.0)) * maxCos), Float32(Float32(Float32(maxCos * Float32(Float32(1.0) - ux)) * ux) * ux), Float32(1.0))) * fma(sin(Float32(Float32(pi) * Float32(uy + uy))), yi, Float32(cos(Float32(Float32(-fma(Float32(uy + uy), Float32(pi), Float32(1.5707963705062866))) + Float32(1.5707963705062866))) * xi))))
end
\mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\left(-\mathsf{fma}\left(uy + uy, \pi, 1.5707963705062866\right)\right) + 1.5707963705062866\right) \cdot xi\right)\right)
Derivation
  1. Initial program 98.9%

    \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
  2. Applied rewrites99.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
  3. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right) \cdot zi}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    2. lift-*.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right)} \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    3. associate-*l*N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{maxCos \cdot \left(ux \cdot zi\right)}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    5. lower-*.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    7. lower-*.f3299.0%

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
  4. Applied rewrites99.0%

    \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
  5. Step-by-step derivation
    1. lift-cos.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \color{blue}{\cos \left(\pi \cdot \left(uy + uy\right)\right)} \cdot xi\right)\right) \]
    2. lift-*.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \color{blue}{\left(\pi \cdot \left(uy + uy\right)\right)} \cdot xi\right)\right) \]
    3. lift-+.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \color{blue}{\left(uy + uy\right)}\right) \cdot xi\right)\right) \]
    4. distribute-rgt-inN/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \color{blue}{\left(uy \cdot \pi + uy \cdot \pi\right)} \cdot xi\right)\right) \]
    5. lift-*.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\color{blue}{uy \cdot \pi} + uy \cdot \pi\right) \cdot xi\right)\right) \]
    6. lift-*.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(uy \cdot \pi + \color{blue}{uy \cdot \pi}\right) \cdot xi\right)\right) \]
    7. cos-sum-revN/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \color{blue}{\left(\cos \left(uy \cdot \pi\right) \cdot \cos \left(uy \cdot \pi\right) - \sin \left(uy \cdot \pi\right) \cdot \sin \left(uy \cdot \pi\right)\right)} \cdot xi\right)\right) \]
    8. sub-negate-revN/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \color{blue}{\left(\mathsf{neg}\left(\left(\sin \left(uy \cdot \pi\right) \cdot \sin \left(uy \cdot \pi\right) - \cos \left(uy \cdot \pi\right) \cdot \cos \left(uy \cdot \pi\right)\right)\right)\right)} \cdot xi\right)\right) \]
    9. sub-negateN/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(\cos \left(uy \cdot \pi\right) \cdot \cos \left(uy \cdot \pi\right) - \sin \left(uy \cdot \pi\right) \cdot \sin \left(uy \cdot \pi\right)\right)\right)\right)}\right)\right) \cdot xi\right)\right) \]
    10. cos-sum-revN/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\cos \left(uy \cdot \pi + uy \cdot \pi\right)}\right)\right)\right)\right) \cdot xi\right)\right) \]
    11. lift-*.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\cos \left(\color{blue}{uy \cdot \pi} + uy \cdot \pi\right)\right)\right)\right)\right) \cdot xi\right)\right) \]
    12. lift-*.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\cos \left(uy \cdot \pi + \color{blue}{uy \cdot \pi}\right)\right)\right)\right)\right) \cdot xi\right)\right) \]
    13. distribute-rgt-inN/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\cos \color{blue}{\left(\pi \cdot \left(uy + uy\right)\right)}\right)\right)\right)\right) \cdot xi\right)\right) \]
    14. lift-+.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \color{blue}{\left(uy + uy\right)}\right)\right)\right)\right)\right) \cdot xi\right)\right) \]
    15. lift-*.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\cos \color{blue}{\left(\pi \cdot \left(uy + uy\right)\right)}\right)\right)\right)\right) \cdot xi\right)\right) \]
    16. sin-+PI/2-revN/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\sin \left(\pi \cdot \left(uy + uy\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}\right)\right)\right)\right) \cdot xi\right)\right) \]
  6. Applied rewrites98.9%

    \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \color{blue}{\cos \left(\left(-\mathsf{fma}\left(uy + uy, \pi, \pi \cdot 0.5\right)\right) + \pi \cdot 0.5\right)} \cdot xi\right)\right) \]
  7. Evaluated real constant98.9%

    \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\left(-\mathsf{fma}\left(uy + uy, \pi, \color{blue}{1.5707963705062866}\right)\right) + \pi \cdot 0.5\right) \cdot xi\right)\right) \]
  8. Evaluated real constant98.9%

    \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\left(-\mathsf{fma}\left(uy + uy, \pi, 1.5707963705062866\right)\right) + \color{blue}{1.5707963705062866}\right) \cdot xi\right)\right) \]
  9. Add Preprocessing

Alternative 3: 98.9% accurate, 1.2× speedup?

\[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
\[\begin{array}{l} t_0 := \pi \cdot \left(uy + uy\right)\\ \mathsf{fma}\left(1 - ux, maxCos \cdot \left(zi \cdot ux\right), \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin t\_0, yi, \cos t\_0 \cdot xi\right)\right) \end{array} \]
(FPCore (xi yi zi ux uy maxCos)
  :precision binary32
  :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                         (and (<= -10000.0 yi) (<= yi 10000.0)))
                    (and (<= -10000.0 zi) (<= zi 10000.0)))
               (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
          (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
     (and (<= 0.0 maxCos) (<= maxCos 1.0)))
  (let* ((t_0 (* PI (+ uy uy))))
  (fma
   (- 1.0 ux)
   (* maxCos (* zi ux))
   (*
    (sqrt
     (fma
      (* (- ux 1.0) maxCos)
      (* (* (* maxCos (- 1.0 ux)) ux) ux)
      1.0))
    (fma (sin t_0) yi (* (cos t_0) xi))))))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
	float t_0 = ((float) M_PI) * (uy + uy);
	return fmaf((1.0f - ux), (maxCos * (zi * ux)), (sqrtf(fmaf(((ux - 1.0f) * maxCos), (((maxCos * (1.0f - ux)) * ux) * ux), 1.0f)) * fmaf(sinf(t_0), yi, (cosf(t_0) * xi))));
}
function code(xi, yi, zi, ux, uy, maxCos)
	t_0 = Float32(Float32(pi) * Float32(uy + uy))
	return fma(Float32(Float32(1.0) - ux), Float32(maxCos * Float32(zi * ux)), Float32(sqrt(fma(Float32(Float32(ux - Float32(1.0)) * maxCos), Float32(Float32(Float32(maxCos * Float32(Float32(1.0) - ux)) * ux) * ux), Float32(1.0))) * fma(sin(t_0), yi, Float32(cos(t_0) * xi))))
end
\begin{array}{l}
t_0 := \pi \cdot \left(uy + uy\right)\\
\mathsf{fma}\left(1 - ux, maxCos \cdot \left(zi \cdot ux\right), \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin t\_0, yi, \cos t\_0 \cdot xi\right)\right)
\end{array}
Derivation
  1. Initial program 98.9%

    \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
  2. Applied rewrites99.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, maxCos \cdot \left(zi \cdot ux\right), \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
  3. Add Preprocessing

Alternative 4: 98.8% accurate, 1.3× speedup?

\[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
\[\begin{array}{l} t_0 := \pi \cdot \left(uy + uy\right)\\ \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(maxCos \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin t\_0, yi, \cos t\_0 \cdot xi\right)\right) \end{array} \]
(FPCore (xi yi zi ux uy maxCos)
  :precision binary32
  :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                         (and (<= -10000.0 yi) (<= yi 10000.0)))
                    (and (<= -10000.0 zi) (<= zi 10000.0)))
               (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
          (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
     (and (<= 0.0 maxCos) (<= maxCos 1.0)))
  (let* ((t_0 (* PI (+ uy uy))))
  (fma
   (- 1.0 ux)
   (* (* zi ux) maxCos)
   (*
    (sqrt (fma (* (- ux 1.0) maxCos) (* (* maxCos ux) ux) 1.0))
    (fma (sin t_0) yi (* (cos t_0) xi))))))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
	float t_0 = ((float) M_PI) * (uy + uy);
	return fmaf((1.0f - ux), ((zi * ux) * maxCos), (sqrtf(fmaf(((ux - 1.0f) * maxCos), ((maxCos * ux) * ux), 1.0f)) * fmaf(sinf(t_0), yi, (cosf(t_0) * xi))));
}
function code(xi, yi, zi, ux, uy, maxCos)
	t_0 = Float32(Float32(pi) * Float32(uy + uy))
	return fma(Float32(Float32(1.0) - ux), Float32(Float32(zi * ux) * maxCos), Float32(sqrt(fma(Float32(Float32(ux - Float32(1.0)) * maxCos), Float32(Float32(maxCos * ux) * ux), Float32(1.0))) * fma(sin(t_0), yi, Float32(cos(t_0) * xi))))
end
\begin{array}{l}
t_0 := \pi \cdot \left(uy + uy\right)\\
\mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(maxCos \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin t\_0, yi, \cos t\_0 \cdot xi\right)\right)
\end{array}
Derivation
  1. Initial program 98.9%

    \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
  2. Applied rewrites99.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
  3. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right) \cdot zi}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    2. lift-*.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right)} \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    3. associate-*l*N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{maxCos \cdot \left(ux \cdot zi\right)}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    5. lower-*.f32N/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    7. lower-*.f3299.0%

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
  4. Applied rewrites99.0%

    \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
  5. Taylor expanded in ux around 0

    \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\color{blue}{maxCos} \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
  6. Step-by-step derivation
    1. Applied rewrites98.8%

      \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\color{blue}{maxCos} \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
    2. Add Preprocessing

    Alternative 5: 98.7% accurate, 1.6× speedup?

    \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
    \[\begin{array}{l} t_0 := \left(\pi + \pi\right) \cdot uy\\ \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \mathsf{fma}\left(\sin t\_0, yi, \cos t\_0 \cdot xi\right)\right) \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
      :precision binary32
      :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                             (and (<= -10000.0 yi) (<= yi 10000.0)))
                        (and (<= -10000.0 zi) (<= zi 10000.0)))
                   (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
              (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
         (and (<= 0.0 maxCos) (<= maxCos 1.0)))
      (let* ((t_0 (* (+ PI PI) uy)))
      (fma
       (- 1.0 ux)
       (* (* zi ux) maxCos)
       (fma (sin t_0) yi (* (cos t_0) xi)))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	float t_0 = (((float) M_PI) + ((float) M_PI)) * uy;
    	return fmaf((1.0f - ux), ((zi * ux) * maxCos), fmaf(sinf(t_0), yi, (cosf(t_0) * xi)));
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	t_0 = Float32(Float32(Float32(pi) + Float32(pi)) * uy)
    	return fma(Float32(Float32(1.0) - ux), Float32(Float32(zi * ux) * maxCos), fma(sin(t_0), yi, Float32(cos(t_0) * xi)))
    end
    
    \begin{array}{l}
    t_0 := \left(\pi + \pi\right) \cdot uy\\
    \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \mathsf{fma}\left(\sin t\_0, yi, \cos t\_0 \cdot xi\right)\right)
    \end{array}
    
    Derivation
    1. Initial program 98.9%

      \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
    2. Taylor expanded in uy around 0

      \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
    3. Step-by-step derivation
      1. lower-fma.f32N/A

        \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
      2. lower-*.f32N/A

        \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
      3. lower-*.f32N/A

        \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
      4. lower--.f32N/A

        \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
      5. lower-*.f32N/A

        \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
      6. lower-sqrt.f32N/A

        \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
      7. lower--.f32N/A

        \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
    4. Applied rewrites51.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
    5. Taylor expanded in maxCos around 0

      \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lower-fma.f32N/A

        \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      2. lower-*.f32N/A

        \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      3. lower-*.f32N/A

        \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower--.f32N/A

        \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      5. lower-fma.f32N/A

        \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
    7. Applied rewrites98.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. lift-fma.f32N/A

        \[\leadsto maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{\mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) \cdot maxCos + \mathsf{fma}\left(\color{blue}{xi}, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
      3. lift-*.f32N/A

        \[\leadsto \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) \cdot maxCos + \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \left(\left(zi \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot maxCos + \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
      5. lift-*.f32N/A

        \[\leadsto \left(\left(zi \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot maxCos + \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(\left(\left(1 - ux\right) \cdot zi\right) \cdot ux\right) \cdot maxCos + \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \left(\left(1 - ux\right) \cdot \left(zi \cdot ux\right)\right) \cdot maxCos + \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
      8. lift-*.f32N/A

        \[\leadsto \left(\left(1 - ux\right) \cdot \left(zi \cdot ux\right)\right) \cdot maxCos + \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \left(1 - ux\right) \cdot \left(\left(zi \cdot ux\right) \cdot maxCos\right) + \mathsf{fma}\left(\color{blue}{xi}, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
      10. lift-*.f32N/A

        \[\leadsto \left(1 - ux\right) \cdot \left(\left(zi \cdot ux\right) \cdot maxCos\right) + \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
      11. lower-fma.f3298.7%

        \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right) \cdot maxCos}, \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
      12. lift-fma.f32N/A

        \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
      13. lift-*.f32N/A

        \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
    9. Applied rewrites98.7%

      \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right) \cdot maxCos}, \mathsf{fma}\left(\sin \left(\left(\pi + \pi\right) \cdot uy\right), yi, \cos \left(\left(\pi + \pi\right) \cdot uy\right) \cdot xi\right)\right) \]
    10. Add Preprocessing

    Alternative 6: 98.2% accurate, 1.6× speedup?

    \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
    \[\begin{array}{l} t_0 := 2 \cdot \left(uy \cdot \pi\right)\\ \mathbf{if}\;uy \leq 0.008500000461935997:\\ \;\;\;\;xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \mathsf{fma}\left(2, yi \cdot \pi, uy \cdot \mathsf{fma}\left(-2, xi \cdot {\pi}^{2}, -1.3333333333333333 \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(maxCos, ux \cdot zi, \mathsf{fma}\left(xi, \cos t\_0, yi \cdot \sin t\_0\right)\right)\\ \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
      :precision binary32
      :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                             (and (<= -10000.0 yi) (<= yi 10000.0)))
                        (and (<= -10000.0 zi) (<= zi 10000.0)))
                   (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
              (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
         (and (<= 0.0 maxCos) (<= maxCos 1.0)))
      (let* ((t_0 (* 2.0 (* uy PI))))
      (if (<= uy 0.008500000461935997)
        (+
         xi
         (fma
          maxCos
          (* ux (* zi (- 1.0 ux)))
          (*
           uy
           (fma
            2.0
            (* yi PI)
            (*
             uy
             (fma
              -2.0
              (* xi (pow PI 2.0))
              (* -1.3333333333333333 (* uy (* yi (pow PI 3.0))))))))))
        (fma maxCos (* ux zi) (fma xi (cos t_0) (* yi (sin t_0)))))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	float t_0 = 2.0f * (uy * ((float) M_PI));
    	float tmp;
    	if (uy <= 0.008500000461935997f) {
    		tmp = xi + fmaf(maxCos, (ux * (zi * (1.0f - ux))), (uy * fmaf(2.0f, (yi * ((float) M_PI)), (uy * fmaf(-2.0f, (xi * powf(((float) M_PI), 2.0f)), (-1.3333333333333333f * (uy * (yi * powf(((float) M_PI), 3.0f)))))))));
    	} else {
    		tmp = fmaf(maxCos, (ux * zi), fmaf(xi, cosf(t_0), (yi * sinf(t_0))));
    	}
    	return tmp;
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	t_0 = Float32(Float32(2.0) * Float32(uy * Float32(pi)))
    	tmp = Float32(0.0)
    	if (uy <= Float32(0.008500000461935997))
    		tmp = Float32(xi + fma(maxCos, Float32(ux * Float32(zi * Float32(Float32(1.0) - ux))), Float32(uy * fma(Float32(2.0), Float32(yi * Float32(pi)), Float32(uy * fma(Float32(-2.0), Float32(xi * (Float32(pi) ^ Float32(2.0))), Float32(Float32(-1.3333333333333333) * Float32(uy * Float32(yi * (Float32(pi) ^ Float32(3.0)))))))))));
    	else
    		tmp = fma(maxCos, Float32(ux * zi), fma(xi, cos(t_0), Float32(yi * sin(t_0))));
    	end
    	return tmp
    end
    
    \begin{array}{l}
    t_0 := 2 \cdot \left(uy \cdot \pi\right)\\
    \mathbf{if}\;uy \leq 0.008500000461935997:\\
    \;\;\;\;xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \mathsf{fma}\left(2, yi \cdot \pi, uy \cdot \mathsf{fma}\left(-2, xi \cdot {\pi}^{2}, -1.3333333333333333 \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(maxCos, ux \cdot zi, \mathsf{fma}\left(xi, \cos t\_0, yi \cdot \sin t\_0\right)\right)\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if uy < 0.00850000046

      1. Initial program 98.9%

        \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
      2. Taylor expanded in uy around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
      3. Step-by-step derivation
        1. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        2. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        3. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        4. lower--.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        5. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        6. lower-sqrt.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        7. lower--.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
      4. Applied rewrites51.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
      5. Taylor expanded in maxCos around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
      6. Step-by-step derivation
        1. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        2. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        3. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        4. lower--.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        5. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      7. Applied rewrites98.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
      8. Taylor expanded in uy around 0

        \[\leadsto xi + \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(yi \cdot \pi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\pi}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)} \]
      9. Step-by-step derivation
        1. lower-+.f32N/A

          \[\leadsto xi + \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)}\right) \]
        2. lower-fma.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        3. lower-*.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        4. lower-*.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        5. lower--.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        6. lower-*.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
      10. Applied rewrites89.6%

        \[\leadsto xi + \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \mathsf{fma}\left(2, yi \cdot \pi, uy \cdot \mathsf{fma}\left(-2, xi \cdot {\pi}^{2}, -1.3333333333333333 \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)} \]

      if 0.00850000046 < uy

      1. Initial program 98.9%

        \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
      2. Taylor expanded in ux around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot zi\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
      3. Step-by-step derivation
        1. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot zi}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        2. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{zi}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        3. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot zi, \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        4. lower-cos.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot zi, \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        5. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot zi, \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        6. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot zi, \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        7. lower-PI.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot zi, \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        8. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot zi, \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      4. Applied rewrites95.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot zi, \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 7: 91.9% accurate, 1.7× speedup?

    \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
    \[\begin{array}{l} \mathbf{if}\;uy \leq 0.10849999636411667:\\ \;\;\;\;xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \mathsf{fma}\left(2, yi \cdot \pi, uy \cdot \mathsf{fma}\left(-2, xi \cdot {\pi}^{2}, -1.3333333333333333 \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + \frac{xi}{yi}\right)\right)\right)\\ \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
      :precision binary32
      :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                             (and (<= -10000.0 yi) (<= yi 10000.0)))
                        (and (<= -10000.0 zi) (<= zi 10000.0)))
                   (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
              (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
         (and (<= 0.0 maxCos) (<= maxCos 1.0)))
      (if (<= uy 0.10849999636411667)
      (+
       xi
       (fma
        maxCos
        (* ux (* zi (- 1.0 ux)))
        (*
         uy
         (fma
          2.0
          (* yi PI)
          (*
           uy
           (fma
            -2.0
            (* xi (pow PI 2.0))
            (* -1.3333333333333333 (* uy (* yi (pow PI 3.0))))))))))
      (fma
       (- 1.0 ux)
       (* (* zi ux) maxCos)
       (*
        (sqrt
         (fma
          (* (- ux 1.0) maxCos)
          (* (* (* maxCos (- 1.0 ux)) ux) ux)
          1.0))
        (* yi (+ (sin (* 2.0 (* uy PI))) (/ xi yi)))))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	float tmp;
    	if (uy <= 0.10849999636411667f) {
    		tmp = xi + fmaf(maxCos, (ux * (zi * (1.0f - ux))), (uy * fmaf(2.0f, (yi * ((float) M_PI)), (uy * fmaf(-2.0f, (xi * powf(((float) M_PI), 2.0f)), (-1.3333333333333333f * (uy * (yi * powf(((float) M_PI), 3.0f)))))))));
    	} else {
    		tmp = fmaf((1.0f - ux), ((zi * ux) * maxCos), (sqrtf(fmaf(((ux - 1.0f) * maxCos), (((maxCos * (1.0f - ux)) * ux) * ux), 1.0f)) * (yi * (sinf((2.0f * (uy * ((float) M_PI)))) + (xi / yi)))));
    	}
    	return tmp;
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	tmp = Float32(0.0)
    	if (uy <= Float32(0.10849999636411667))
    		tmp = Float32(xi + fma(maxCos, Float32(ux * Float32(zi * Float32(Float32(1.0) - ux))), Float32(uy * fma(Float32(2.0), Float32(yi * Float32(pi)), Float32(uy * fma(Float32(-2.0), Float32(xi * (Float32(pi) ^ Float32(2.0))), Float32(Float32(-1.3333333333333333) * Float32(uy * Float32(yi * (Float32(pi) ^ Float32(3.0)))))))))));
    	else
    		tmp = fma(Float32(Float32(1.0) - ux), Float32(Float32(zi * ux) * maxCos), Float32(sqrt(fma(Float32(Float32(ux - Float32(1.0)) * maxCos), Float32(Float32(Float32(maxCos * Float32(Float32(1.0) - ux)) * ux) * ux), Float32(1.0))) * Float32(yi * Float32(sin(Float32(Float32(2.0) * Float32(uy * Float32(pi)))) + Float32(xi / yi)))));
    	end
    	return tmp
    end
    
    \begin{array}{l}
    \mathbf{if}\;uy \leq 0.10849999636411667:\\
    \;\;\;\;xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \mathsf{fma}\left(2, yi \cdot \pi, uy \cdot \mathsf{fma}\left(-2, xi \cdot {\pi}^{2}, -1.3333333333333333 \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + \frac{xi}{yi}\right)\right)\right)\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if uy < 0.108499996

      1. Initial program 98.9%

        \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
      2. Taylor expanded in uy around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
      3. Step-by-step derivation
        1. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        2. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        3. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        4. lower--.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        5. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        6. lower-sqrt.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        7. lower--.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
      4. Applied rewrites51.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
      5. Taylor expanded in maxCos around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
      6. Step-by-step derivation
        1. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        2. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        3. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        4. lower--.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        5. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      7. Applied rewrites98.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
      8. Taylor expanded in uy around 0

        \[\leadsto xi + \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(yi \cdot \pi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\pi}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)} \]
      9. Step-by-step derivation
        1. lower-+.f32N/A

          \[\leadsto xi + \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)}\right) \]
        2. lower-fma.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        3. lower-*.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        4. lower-*.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        5. lower--.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        6. lower-*.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
      10. Applied rewrites89.6%

        \[\leadsto xi + \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \mathsf{fma}\left(2, yi \cdot \pi, uy \cdot \mathsf{fma}\left(-2, xi \cdot {\pi}^{2}, -1.3333333333333333 \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)} \]

      if 0.108499996 < uy

      1. Initial program 98.9%

        \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
      2. Applied rewrites99.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
      3. Step-by-step derivation
        1. lift-*.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right) \cdot zi}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
        2. lift-*.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right)} \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
        3. associate-*l*N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{maxCos \cdot \left(ux \cdot zi\right)}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
        5. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
        7. lower-*.f3299.0%

          \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
      4. Applied rewrites99.0%

        \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
      5. Taylor expanded in yi around inf

        \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + \frac{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right)}{yi}\right)\right)}\right) \]
      6. Step-by-step derivation
        1. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \color{blue}{\left(\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \frac{xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{yi}\right)}\right)\right) \]
        2. lower-+.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\frac{xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{yi}}\right)\right)\right) \]
        3. lower-sin.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \frac{\color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}}{yi}\right)\right)\right) \]
        4. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \frac{\color{blue}{xi} \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{yi}\right)\right)\right) \]
        5. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \frac{xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{yi}\right)\right)\right) \]
        6. lower-PI.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + \frac{xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{yi}\right)\right)\right) \]
        7. lower-/.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + \frac{xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{\color{blue}{yi}}\right)\right)\right) \]
      7. Applied rewrites98.3%

        \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + \frac{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right)}{yi}\right)\right)}\right) \]
      8. Taylor expanded in uy around 0

        \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + \frac{xi}{\color{blue}{yi}}\right)\right)\right) \]
      9. Step-by-step derivation
        1. lower-/.f3288.3%

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + \frac{xi}{yi}\right)\right)\right) \]
      10. Applied rewrites88.3%

        \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \left(\sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + \frac{xi}{\color{blue}{yi}}\right)\right)\right) \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 8: 91.6% accurate, 1.8× speedup?

    \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
    \[\begin{array}{l} \mathbf{if}\;uy \leq 0.10849999636411667:\\ \;\;\;\;xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \mathsf{fma}\left(2, yi \cdot \pi, uy \cdot \mathsf{fma}\left(-2, xi \cdot {\pi}^{2}, -1.3333333333333333 \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot zi, ux, \left(\sin \left(\left(uy + uy\right) \cdot \pi\right) \cdot yi\right) \cdot \sqrt{\mathsf{fma}\left(\left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot maxCos, \left(1 - ux\right) \cdot ux, 1\right)}\right)\\ \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
      :precision binary32
      :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                             (and (<= -10000.0 yi) (<= yi 10000.0)))
                        (and (<= -10000.0 zi) (<= zi 10000.0)))
                   (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
              (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
         (and (<= 0.0 maxCos) (<= maxCos 1.0)))
      (if (<= uy 0.10849999636411667)
      (+
       xi
       (fma
        maxCos
        (* ux (* zi (- 1.0 ux)))
        (*
         uy
         (fma
          2.0
          (* yi PI)
          (*
           uy
           (fma
            -2.0
            (* xi (pow PI 2.0))
            (* -1.3333333333333333 (* uy (* yi (pow PI 3.0))))))))))
      (fma
       (* (* maxCos (- 1.0 ux)) zi)
       ux
       (*
        (* (sin (* (+ uy uy) PI)) yi)
        (sqrt
         (fma
          (* (* (* (- ux 1.0) maxCos) ux) maxCos)
          (* (- 1.0 ux) ux)
          1.0))))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	float tmp;
    	if (uy <= 0.10849999636411667f) {
    		tmp = xi + fmaf(maxCos, (ux * (zi * (1.0f - ux))), (uy * fmaf(2.0f, (yi * ((float) M_PI)), (uy * fmaf(-2.0f, (xi * powf(((float) M_PI), 2.0f)), (-1.3333333333333333f * (uy * (yi * powf(((float) M_PI), 3.0f)))))))));
    	} else {
    		tmp = fmaf(((maxCos * (1.0f - ux)) * zi), ux, ((sinf(((uy + uy) * ((float) M_PI))) * yi) * sqrtf(fmaf(((((ux - 1.0f) * maxCos) * ux) * maxCos), ((1.0f - ux) * ux), 1.0f))));
    	}
    	return tmp;
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	tmp = Float32(0.0)
    	if (uy <= Float32(0.10849999636411667))
    		tmp = Float32(xi + fma(maxCos, Float32(ux * Float32(zi * Float32(Float32(1.0) - ux))), Float32(uy * fma(Float32(2.0), Float32(yi * Float32(pi)), Float32(uy * fma(Float32(-2.0), Float32(xi * (Float32(pi) ^ Float32(2.0))), Float32(Float32(-1.3333333333333333) * Float32(uy * Float32(yi * (Float32(pi) ^ Float32(3.0)))))))))));
    	else
    		tmp = fma(Float32(Float32(maxCos * Float32(Float32(1.0) - ux)) * zi), ux, Float32(Float32(sin(Float32(Float32(uy + uy) * Float32(pi))) * yi) * sqrt(fma(Float32(Float32(Float32(Float32(ux - Float32(1.0)) * maxCos) * ux) * maxCos), Float32(Float32(Float32(1.0) - ux) * ux), Float32(1.0)))));
    	end
    	return tmp
    end
    
    \begin{array}{l}
    \mathbf{if}\;uy \leq 0.10849999636411667:\\
    \;\;\;\;xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \mathsf{fma}\left(2, yi \cdot \pi, uy \cdot \mathsf{fma}\left(-2, xi \cdot {\pi}^{2}, -1.3333333333333333 \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot zi, ux, \left(\sin \left(\left(uy + uy\right) \cdot \pi\right) \cdot yi\right) \cdot \sqrt{\mathsf{fma}\left(\left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot maxCos, \left(1 - ux\right) \cdot ux, 1\right)}\right)\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if uy < 0.108499996

      1. Initial program 98.9%

        \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
      2. Taylor expanded in uy around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
      3. Step-by-step derivation
        1. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        2. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        3. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        4. lower--.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        5. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        6. lower-sqrt.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        7. lower--.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
      4. Applied rewrites51.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
      5. Taylor expanded in maxCos around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
      6. Step-by-step derivation
        1. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        2. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        3. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        4. lower--.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        5. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      7. Applied rewrites98.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
      8. Taylor expanded in uy around 0

        \[\leadsto xi + \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(yi \cdot \pi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\pi}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)} \]
      9. Step-by-step derivation
        1. lower-+.f32N/A

          \[\leadsto xi + \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)}\right) \]
        2. lower-fma.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        3. lower-*.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        4. lower-*.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        5. lower--.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        6. lower-*.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
      10. Applied rewrites89.6%

        \[\leadsto xi + \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \mathsf{fma}\left(2, yi \cdot \pi, uy \cdot \mathsf{fma}\left(-2, xi \cdot {\pi}^{2}, -1.3333333333333333 \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)} \]

      if 0.108499996 < uy

      1. Initial program 98.9%

        \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
      2. Applied rewrites99.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
      3. Taylor expanded in xi around 0

        \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)}\right) \]
      4. Step-by-step derivation
        1. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
        2. lower-sin.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        3. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        4. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        5. lower-PI.f3244.8%

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
      5. Applied rewrites44.8%

        \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)}\right) \]
      6. Applied rewrites44.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot zi, ux, \left(\sin \left(\left(uy + uy\right) \cdot \pi\right) \cdot yi\right) \cdot \sqrt{\mathsf{fma}\left(\left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot maxCos, \left(1 - ux\right) \cdot ux, 1\right)}\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 9: 91.6% accurate, 1.9× speedup?

    \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
    \[\begin{array}{l} \mathbf{if}\;uy \leq 0.10849999636411667:\\ \;\;\;\;xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \mathsf{fma}\left(2, yi \cdot \pi, uy \cdot \mathsf{fma}\left(-2, xi \cdot {\pi}^{2}, -1.3333333333333333 \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(maxCos \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)\\ \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
      :precision binary32
      :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                             (and (<= -10000.0 yi) (<= yi 10000.0)))
                        (and (<= -10000.0 zi) (<= zi 10000.0)))
                   (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
              (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
         (and (<= 0.0 maxCos) (<= maxCos 1.0)))
      (if (<= uy 0.10849999636411667)
      (+
       xi
       (fma
        maxCos
        (* ux (* zi (- 1.0 ux)))
        (*
         uy
         (fma
          2.0
          (* yi PI)
          (*
           uy
           (fma
            -2.0
            (* xi (pow PI 2.0))
            (* -1.3333333333333333 (* uy (* yi (pow PI 3.0))))))))))
      (fma
       (- 1.0 ux)
       (* (* maxCos ux) zi)
       (*
        (sqrt (fma (* (- ux 1.0) maxCos) (* (* maxCos ux) ux) 1.0))
        (* yi (sin (* 2.0 (* uy PI))))))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	float tmp;
    	if (uy <= 0.10849999636411667f) {
    		tmp = xi + fmaf(maxCos, (ux * (zi * (1.0f - ux))), (uy * fmaf(2.0f, (yi * ((float) M_PI)), (uy * fmaf(-2.0f, (xi * powf(((float) M_PI), 2.0f)), (-1.3333333333333333f * (uy * (yi * powf(((float) M_PI), 3.0f)))))))));
    	} else {
    		tmp = fmaf((1.0f - ux), ((maxCos * ux) * zi), (sqrtf(fmaf(((ux - 1.0f) * maxCos), ((maxCos * ux) * ux), 1.0f)) * (yi * sinf((2.0f * (uy * ((float) M_PI)))))));
    	}
    	return tmp;
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	tmp = Float32(0.0)
    	if (uy <= Float32(0.10849999636411667))
    		tmp = Float32(xi + fma(maxCos, Float32(ux * Float32(zi * Float32(Float32(1.0) - ux))), Float32(uy * fma(Float32(2.0), Float32(yi * Float32(pi)), Float32(uy * fma(Float32(-2.0), Float32(xi * (Float32(pi) ^ Float32(2.0))), Float32(Float32(-1.3333333333333333) * Float32(uy * Float32(yi * (Float32(pi) ^ Float32(3.0)))))))))));
    	else
    		tmp = fma(Float32(Float32(1.0) - ux), Float32(Float32(maxCos * ux) * zi), Float32(sqrt(fma(Float32(Float32(ux - Float32(1.0)) * maxCos), Float32(Float32(maxCos * ux) * ux), Float32(1.0))) * Float32(yi * sin(Float32(Float32(2.0) * Float32(uy * Float32(pi)))))));
    	end
    	return tmp
    end
    
    \begin{array}{l}
    \mathbf{if}\;uy \leq 0.10849999636411667:\\
    \;\;\;\;xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \mathsf{fma}\left(2, yi \cdot \pi, uy \cdot \mathsf{fma}\left(-2, xi \cdot {\pi}^{2}, -1.3333333333333333 \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(maxCos \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if uy < 0.108499996

      1. Initial program 98.9%

        \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
      2. Taylor expanded in uy around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
      3. Step-by-step derivation
        1. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        2. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        3. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        4. lower--.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        5. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        6. lower-sqrt.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
        7. lower--.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
      4. Applied rewrites51.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
      5. Taylor expanded in maxCos around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
      6. Step-by-step derivation
        1. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        2. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        3. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        4. lower--.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        5. lower-fma.f32N/A

          \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      7. Applied rewrites98.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
      8. Taylor expanded in uy around 0

        \[\leadsto xi + \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(yi \cdot \pi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\pi}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)} \]
      9. Step-by-step derivation
        1. lower-+.f32N/A

          \[\leadsto xi + \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)}\right) \]
        2. lower-fma.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        3. lower-*.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        4. lower-*.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        5. lower--.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
        6. lower-*.f32N/A

          \[\leadsto xi + \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right) \]
      10. Applied rewrites89.6%

        \[\leadsto xi + \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), uy \cdot \mathsf{fma}\left(2, yi \cdot \pi, uy \cdot \mathsf{fma}\left(-2, xi \cdot {\pi}^{2}, -1.3333333333333333 \cdot \left(uy \cdot \left(yi \cdot {\pi}^{3}\right)\right)\right)\right)\right)} \]

      if 0.108499996 < uy

      1. Initial program 98.9%

        \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
      2. Applied rewrites99.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
      3. Taylor expanded in xi around 0

        \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)}\right) \]
      4. Step-by-step derivation
        1. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
        2. lower-sin.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        3. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        4. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        5. lower-PI.f3244.8%

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
      5. Applied rewrites44.8%

        \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)}\right) \]
      6. Taylor expanded in ux around 0

        \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\color{blue}{maxCos} \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
      7. Step-by-step derivation
        1. Applied rewrites44.7%

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\color{blue}{maxCos} \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
      8. Recombined 2 regimes into one program.
      9. Add Preprocessing

      Alternative 10: 87.6% accurate, 1.9× speedup?

      \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
      \[\begin{array}{l} t_0 := \left(ux - 1\right) \cdot maxCos\\ \mathbf{if}\;uy \leq 0.009999999776482582:\\ \;\;\;\;\mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(t\_0, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(t\_0, \left(maxCos \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)\\ \end{array} \]
      (FPCore (xi yi zi ux uy maxCos)
        :precision binary32
        :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                               (and (<= -10000.0 yi) (<= yi 10000.0)))
                          (and (<= -10000.0 zi) (<= zi 10000.0)))
                     (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
           (and (<= 0.0 maxCos) (<= maxCos 1.0)))
        (let* ((t_0 (* (- ux 1.0) maxCos)))
        (if (<= uy 0.009999999776482582)
          (fma
           (- 1.0 ux)
           (* (* zi ux) maxCos)
           (*
            (sqrt (fma t_0 (* (* (* maxCos (- 1.0 ux)) ux) ux) 1.0))
            (+
             xi
             (*
              uy
              (fma -2.0 (* uy (* xi (pow PI 2.0))) (* 2.0 (* yi PI)))))))
          (fma
           (- 1.0 ux)
           (* (* maxCos ux) zi)
           (*
            (sqrt (fma t_0 (* (* maxCos ux) ux) 1.0))
            (* yi (sin (* 2.0 (* uy PI)))))))))
      float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
      	float t_0 = (ux - 1.0f) * maxCos;
      	float tmp;
      	if (uy <= 0.009999999776482582f) {
      		tmp = fmaf((1.0f - ux), ((zi * ux) * maxCos), (sqrtf(fmaf(t_0, (((maxCos * (1.0f - ux)) * ux) * ux), 1.0f)) * (xi + (uy * fmaf(-2.0f, (uy * (xi * powf(((float) M_PI), 2.0f))), (2.0f * (yi * ((float) M_PI))))))));
      	} else {
      		tmp = fmaf((1.0f - ux), ((maxCos * ux) * zi), (sqrtf(fmaf(t_0, ((maxCos * ux) * ux), 1.0f)) * (yi * sinf((2.0f * (uy * ((float) M_PI)))))));
      	}
      	return tmp;
      }
      
      function code(xi, yi, zi, ux, uy, maxCos)
      	t_0 = Float32(Float32(ux - Float32(1.0)) * maxCos)
      	tmp = Float32(0.0)
      	if (uy <= Float32(0.009999999776482582))
      		tmp = fma(Float32(Float32(1.0) - ux), Float32(Float32(zi * ux) * maxCos), Float32(sqrt(fma(t_0, Float32(Float32(Float32(maxCos * Float32(Float32(1.0) - ux)) * ux) * ux), Float32(1.0))) * Float32(xi + Float32(uy * fma(Float32(-2.0), Float32(uy * Float32(xi * (Float32(pi) ^ Float32(2.0)))), Float32(Float32(2.0) * Float32(yi * Float32(pi))))))));
      	else
      		tmp = fma(Float32(Float32(1.0) - ux), Float32(Float32(maxCos * ux) * zi), Float32(sqrt(fma(t_0, Float32(Float32(maxCos * ux) * ux), Float32(1.0))) * Float32(yi * sin(Float32(Float32(2.0) * Float32(uy * Float32(pi)))))));
      	end
      	return tmp
      end
      
      \begin{array}{l}
      t_0 := \left(ux - 1\right) \cdot maxCos\\
      \mathbf{if}\;uy \leq 0.009999999776482582:\\
      \;\;\;\;\mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(t\_0, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(t\_0, \left(maxCos \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if uy < 0.00999999978

        1. Initial program 98.9%

          \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
        2. Applied rewrites99.0%

          \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
        3. Step-by-step derivation
          1. lift-*.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right) \cdot zi}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
          2. lift-*.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right)} \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
          3. associate-*l*N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{maxCos \cdot \left(ux \cdot zi\right)}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
          5. lower-*.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
          6. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
          7. lower-*.f3299.0%

            \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
        4. Applied rewrites99.0%

          \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
        5. Taylor expanded in uy around 0

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\pi}^{2}\right)\right) + 2 \cdot \left(yi \cdot \pi\right)\right)\right)}\right) \]
        6. Step-by-step derivation
          1. lower-+.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + \color{blue}{uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
          2. lower-*.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \color{blue}{\left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
          3. lower-fma.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, \color{blue}{uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)}, 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
          4. lower-*.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \color{blue}{\left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)}, 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
          5. lower-*.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot \color{blue}{{\mathsf{PI}\left(\right)}^{2}}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
          6. lower-pow.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{\color{blue}{2}}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
          7. lower-PI.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
          8. lower-*.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
          9. lower-*.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
          10. lower-PI.f3286.1%

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)\right) \]
        7. Applied rewrites86.1%

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)}\right) \]

        if 0.00999999978 < uy

        1. Initial program 98.9%

          \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
        2. Applied rewrites99.0%

          \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
        3. Taylor expanded in xi around 0

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)}\right) \]
        4. Step-by-step derivation
          1. lower-*.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
          2. lower-sin.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
          3. lower-*.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
          4. lower-*.f32N/A

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
          5. lower-PI.f3244.8%

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
        5. Applied rewrites44.8%

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)}\right) \]
        6. Taylor expanded in ux around 0

          \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\color{blue}{maxCos} \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
        7. Step-by-step derivation
          1. Applied rewrites44.7%

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\color{blue}{maxCos} \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
        8. Recombined 2 regimes into one program.
        9. Add Preprocessing

        Alternative 11: 87.4% accurate, 1.9× speedup?

        \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
        \[\begin{array}{l} t_0 := \left(ux - 1\right) \cdot maxCos\\ t_1 := \left(maxCos \cdot ux\right) \cdot zi\\ \mathbf{if}\;uy \leq 0.009999999776482582:\\ \;\;\;\;\mathsf{fma}\left(1 - ux, t\_1, \sqrt{\mathsf{fma}\left(t\_0, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1 - ux, t\_1, \sqrt{\mathsf{fma}\left(t\_0, \left(maxCos \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)\\ \end{array} \]
        (FPCore (xi yi zi ux uy maxCos)
          :precision binary32
          :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                 (and (<= -10000.0 yi) (<= yi 10000.0)))
                            (and (<= -10000.0 zi) (<= zi 10000.0)))
                       (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                  (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
             (and (<= 0.0 maxCos) (<= maxCos 1.0)))
          (let* ((t_0 (* (- ux 1.0) maxCos)) (t_1 (* (* maxCos ux) zi)))
          (if (<= uy 0.009999999776482582)
            (fma
             (- 1.0 ux)
             t_1
             (*
              (sqrt (fma t_0 (* (* (* maxCos (- 1.0 ux)) ux) ux) 1.0))
              (+
               xi
               (*
                uy
                (fma -2.0 (* uy (* xi (pow PI 2.0))) (* 2.0 (* yi PI)))))))
            (fma
             (- 1.0 ux)
             t_1
             (*
              (sqrt (fma t_0 (* (* maxCos ux) ux) 1.0))
              (* yi (sin (* 2.0 (* uy PI)))))))))
        float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
        	float t_0 = (ux - 1.0f) * maxCos;
        	float t_1 = (maxCos * ux) * zi;
        	float tmp;
        	if (uy <= 0.009999999776482582f) {
        		tmp = fmaf((1.0f - ux), t_1, (sqrtf(fmaf(t_0, (((maxCos * (1.0f - ux)) * ux) * ux), 1.0f)) * (xi + (uy * fmaf(-2.0f, (uy * (xi * powf(((float) M_PI), 2.0f))), (2.0f * (yi * ((float) M_PI))))))));
        	} else {
        		tmp = fmaf((1.0f - ux), t_1, (sqrtf(fmaf(t_0, ((maxCos * ux) * ux), 1.0f)) * (yi * sinf((2.0f * (uy * ((float) M_PI)))))));
        	}
        	return tmp;
        }
        
        function code(xi, yi, zi, ux, uy, maxCos)
        	t_0 = Float32(Float32(ux - Float32(1.0)) * maxCos)
        	t_1 = Float32(Float32(maxCos * ux) * zi)
        	tmp = Float32(0.0)
        	if (uy <= Float32(0.009999999776482582))
        		tmp = fma(Float32(Float32(1.0) - ux), t_1, Float32(sqrt(fma(t_0, Float32(Float32(Float32(maxCos * Float32(Float32(1.0) - ux)) * ux) * ux), Float32(1.0))) * Float32(xi + Float32(uy * fma(Float32(-2.0), Float32(uy * Float32(xi * (Float32(pi) ^ Float32(2.0)))), Float32(Float32(2.0) * Float32(yi * Float32(pi))))))));
        	else
        		tmp = fma(Float32(Float32(1.0) - ux), t_1, Float32(sqrt(fma(t_0, Float32(Float32(maxCos * ux) * ux), Float32(1.0))) * Float32(yi * sin(Float32(Float32(2.0) * Float32(uy * Float32(pi)))))));
        	end
        	return tmp
        end
        
        \begin{array}{l}
        t_0 := \left(ux - 1\right) \cdot maxCos\\
        t_1 := \left(maxCos \cdot ux\right) \cdot zi\\
        \mathbf{if}\;uy \leq 0.009999999776482582:\\
        \;\;\;\;\mathsf{fma}\left(1 - ux, t\_1, \sqrt{\mathsf{fma}\left(t\_0, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(1 - ux, t\_1, \sqrt{\mathsf{fma}\left(t\_0, \left(maxCos \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if uy < 0.00999999978

          1. Initial program 98.9%

            \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
          2. Applied rewrites99.0%

            \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
          3. Taylor expanded in uy around 0

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\pi}^{2}\right)\right) + 2 \cdot \left(yi \cdot \pi\right)\right)\right)}\right) \]
          4. Step-by-step derivation
            1. lower-+.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + \color{blue}{uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
            2. lower-*.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \color{blue}{\left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
            3. lower-fma.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, \color{blue}{uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)}, 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
            4. lower-*.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \color{blue}{\left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)}, 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
            5. lower-*.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot \color{blue}{{\mathsf{PI}\left(\right)}^{2}}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
            6. lower-pow.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{\color{blue}{2}}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
            7. lower-PI.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
            8. lower-*.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
            9. lower-*.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
            10. lower-PI.f3286.1%

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)\right) \]
          5. Applied rewrites86.1%

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)}\right) \]

          if 0.00999999978 < uy

          1. Initial program 98.9%

            \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
          2. Applied rewrites99.0%

            \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
          3. Taylor expanded in xi around 0

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)}\right) \]
          4. Step-by-step derivation
            1. lower-*.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
            2. lower-sin.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
            3. lower-*.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
            4. lower-*.f32N/A

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
            5. lower-PI.f3244.8%

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
          5. Applied rewrites44.8%

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)}\right) \]
          6. Taylor expanded in ux around 0

            \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\color{blue}{maxCos} \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
          7. Step-by-step derivation
            1. Applied rewrites44.7%

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\color{blue}{maxCos} \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
          8. Recombined 2 regimes into one program.
          9. Add Preprocessing

          Alternative 12: 87.4% accurate, 1.9× speedup?

          \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
          \[\begin{array}{l} \mathbf{if}\;uy \leq 0.009999999776482582:\\ \;\;\;\;\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(maxCos \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)\\ \end{array} \]
          (FPCore (xi yi zi ux uy maxCos)
            :precision binary32
            :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                   (and (<= -10000.0 yi) (<= yi 10000.0)))
                              (and (<= -10000.0 zi) (<= zi 10000.0)))
                         (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                    (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
               (and (<= 0.0 maxCos) (<= maxCos 1.0)))
            (if (<= uy 0.009999999776482582)
            (fma
             maxCos
             (* ux (* zi (- 1.0 ux)))
             (+
              xi
              (* uy (fma -2.0 (* uy (* xi (pow PI 2.0))) (* 2.0 (* yi PI))))))
            (fma
             (- 1.0 ux)
             (* (* maxCos ux) zi)
             (*
              (sqrt (fma (* (- ux 1.0) maxCos) (* (* maxCos ux) ux) 1.0))
              (* yi (sin (* 2.0 (* uy PI))))))))
          float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
          	float tmp;
          	if (uy <= 0.009999999776482582f) {
          		tmp = fmaf(maxCos, (ux * (zi * (1.0f - ux))), (xi + (uy * fmaf(-2.0f, (uy * (xi * powf(((float) M_PI), 2.0f))), (2.0f * (yi * ((float) M_PI)))))));
          	} else {
          		tmp = fmaf((1.0f - ux), ((maxCos * ux) * zi), (sqrtf(fmaf(((ux - 1.0f) * maxCos), ((maxCos * ux) * ux), 1.0f)) * (yi * sinf((2.0f * (uy * ((float) M_PI)))))));
          	}
          	return tmp;
          }
          
          function code(xi, yi, zi, ux, uy, maxCos)
          	tmp = Float32(0.0)
          	if (uy <= Float32(0.009999999776482582))
          		tmp = fma(maxCos, Float32(ux * Float32(zi * Float32(Float32(1.0) - ux))), Float32(xi + Float32(uy * fma(Float32(-2.0), Float32(uy * Float32(xi * (Float32(pi) ^ Float32(2.0)))), Float32(Float32(2.0) * Float32(yi * Float32(pi)))))));
          	else
          		tmp = fma(Float32(Float32(1.0) - ux), Float32(Float32(maxCos * ux) * zi), Float32(sqrt(fma(Float32(Float32(ux - Float32(1.0)) * maxCos), Float32(Float32(maxCos * ux) * ux), Float32(1.0))) * Float32(yi * sin(Float32(Float32(2.0) * Float32(uy * Float32(pi)))))));
          	end
          	return tmp
          end
          
          \begin{array}{l}
          \mathbf{if}\;uy \leq 0.009999999776482582:\\
          \;\;\;\;\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(maxCos \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if uy < 0.00999999978

            1. Initial program 98.9%

              \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
            2. Taylor expanded in uy around 0

              \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
            3. Step-by-step derivation
              1. lower-fma.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              2. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              3. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. lower--.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              5. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              6. lower-sqrt.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              7. lower--.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
            4. Applied rewrites51.6%

              \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
            5. Taylor expanded in maxCos around 0

              \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
            6. Step-by-step derivation
              1. lower-fma.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              2. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              3. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              4. lower--.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              5. lower-fma.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
            7. Applied rewrites98.7%

              \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
            8. Taylor expanded in uy around 0

              \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\pi}^{2}\right)\right) + 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]
            9. Step-by-step derivation
              1. lower-+.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              2. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              3. lower-fma.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              4. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              5. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              6. lower-pow.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              7. lower-PI.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              8. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              9. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              10. lower-PI.f3285.9%

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]
            10. Applied rewrites85.9%

              \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]

            if 0.00999999978 < uy

            1. Initial program 98.9%

              \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
            2. Applied rewrites99.0%

              \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
            3. Taylor expanded in xi around 0

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)}\right) \]
            4. Step-by-step derivation
              1. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
              2. lower-sin.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
              3. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
              4. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
              5. lower-PI.f3244.8%

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
            5. Applied rewrites44.8%

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)}\right) \]
            6. Taylor expanded in ux around 0

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\color{blue}{maxCos} \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
            7. Step-by-step derivation
              1. Applied rewrites44.7%

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\color{blue}{maxCos} \cdot ux\right) \cdot ux, 1\right)} \cdot \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right) \]
            8. Recombined 2 regimes into one program.
            9. Add Preprocessing

            Alternative 13: 87.2% accurate, 2.6× speedup?

            \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
            \[\begin{array}{l} t_0 := ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\\ \mathbf{if}\;uy \leq 0.009999999776482582:\\ \;\;\;\;\mathsf{fma}\left(maxCos, t\_0, xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(maxCos, t\_0, yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\\ \end{array} \]
            (FPCore (xi yi zi ux uy maxCos)
              :precision binary32
              :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                     (and (<= -10000.0 yi) (<= yi 10000.0)))
                                (and (<= -10000.0 zi) (<= zi 10000.0)))
                           (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                      (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                 (and (<= 0.0 maxCos) (<= maxCos 1.0)))
              (let* ((t_0 (* ux (* zi (- 1.0 ux)))))
              (if (<= uy 0.009999999776482582)
                (fma
                 maxCos
                 t_0
                 (+
                  xi
                  (* uy (fma -2.0 (* uy (* xi (pow PI 2.0))) (* 2.0 (* yi PI))))))
                (fma maxCos t_0 (* yi (sin (* 2.0 (* uy PI))))))))
            float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
            	float t_0 = ux * (zi * (1.0f - ux));
            	float tmp;
            	if (uy <= 0.009999999776482582f) {
            		tmp = fmaf(maxCos, t_0, (xi + (uy * fmaf(-2.0f, (uy * (xi * powf(((float) M_PI), 2.0f))), (2.0f * (yi * ((float) M_PI)))))));
            	} else {
            		tmp = fmaf(maxCos, t_0, (yi * sinf((2.0f * (uy * ((float) M_PI))))));
            	}
            	return tmp;
            }
            
            function code(xi, yi, zi, ux, uy, maxCos)
            	t_0 = Float32(ux * Float32(zi * Float32(Float32(1.0) - ux)))
            	tmp = Float32(0.0)
            	if (uy <= Float32(0.009999999776482582))
            		tmp = fma(maxCos, t_0, Float32(xi + Float32(uy * fma(Float32(-2.0), Float32(uy * Float32(xi * (Float32(pi) ^ Float32(2.0)))), Float32(Float32(2.0) * Float32(yi * Float32(pi)))))));
            	else
            		tmp = fma(maxCos, t_0, Float32(yi * sin(Float32(Float32(2.0) * Float32(uy * Float32(pi))))));
            	end
            	return tmp
            end
            
            \begin{array}{l}
            t_0 := ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\\
            \mathbf{if}\;uy \leq 0.009999999776482582:\\
            \;\;\;\;\mathsf{fma}\left(maxCos, t\_0, xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(maxCos, t\_0, yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if uy < 0.00999999978

              1. Initial program 98.9%

                \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
              2. Taylor expanded in uy around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
              3. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                6. lower-sqrt.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                7. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. Applied rewrites51.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
              5. Taylor expanded in maxCos around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
              6. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                5. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
              7. Applied rewrites98.7%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
              8. Taylor expanded in uy around 0

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\pi}^{2}\right)\right) + 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]
              9. Step-by-step derivation
                1. lower-+.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                3. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                4. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                6. lower-pow.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                7. lower-PI.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                8. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                9. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                10. lower-PI.f3285.9%

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]
              10. Applied rewrites85.9%

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]

              if 0.00999999978 < uy

              1. Initial program 98.9%

                \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
              2. Taylor expanded in uy around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
              3. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                6. lower-sqrt.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                7. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. Applied rewrites51.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
              5. Taylor expanded in maxCos around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
              6. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                5. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
              7. Applied rewrites98.7%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
              8. Taylor expanded in xi around 0

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
              9. Step-by-step derivation
                1. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                2. lower-sin.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                4. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                5. lower-PI.f3244.7%

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
              10. Applied rewrites44.7%

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 14: 87.2% accurate, 2.6× speedup?

            \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
            \[\begin{array}{l} t_0 := ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\\ \mathbf{if}\;uy \leq 0.30000001192092896:\\ \;\;\;\;\mathsf{fma}\left(maxCos, t\_0, xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(maxCos, t\_0, xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\\ \end{array} \]
            (FPCore (xi yi zi ux uy maxCos)
              :precision binary32
              :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                     (and (<= -10000.0 yi) (<= yi 10000.0)))
                                (and (<= -10000.0 zi) (<= zi 10000.0)))
                           (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                      (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                 (and (<= 0.0 maxCos) (<= maxCos 1.0)))
              (let* ((t_0 (* ux (* zi (- 1.0 ux)))))
              (if (<= uy 0.30000001192092896)
                (fma
                 maxCos
                 t_0
                 (+
                  xi
                  (* uy (fma -2.0 (* uy (* xi (pow PI 2.0))) (* 2.0 (* yi PI))))))
                (fma maxCos t_0 (* xi (cos (* 2.0 (* uy PI))))))))
            float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
            	float t_0 = ux * (zi * (1.0f - ux));
            	float tmp;
            	if (uy <= 0.30000001192092896f) {
            		tmp = fmaf(maxCos, t_0, (xi + (uy * fmaf(-2.0f, (uy * (xi * powf(((float) M_PI), 2.0f))), (2.0f * (yi * ((float) M_PI)))))));
            	} else {
            		tmp = fmaf(maxCos, t_0, (xi * cosf((2.0f * (uy * ((float) M_PI))))));
            	}
            	return tmp;
            }
            
            function code(xi, yi, zi, ux, uy, maxCos)
            	t_0 = Float32(ux * Float32(zi * Float32(Float32(1.0) - ux)))
            	tmp = Float32(0.0)
            	if (uy <= Float32(0.30000001192092896))
            		tmp = fma(maxCos, t_0, Float32(xi + Float32(uy * fma(Float32(-2.0), Float32(uy * Float32(xi * (Float32(pi) ^ Float32(2.0)))), Float32(Float32(2.0) * Float32(yi * Float32(pi)))))));
            	else
            		tmp = fma(maxCos, t_0, Float32(xi * cos(Float32(Float32(2.0) * Float32(uy * Float32(pi))))));
            	end
            	return tmp
            end
            
            \begin{array}{l}
            t_0 := ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\\
            \mathbf{if}\;uy \leq 0.30000001192092896:\\
            \;\;\;\;\mathsf{fma}\left(maxCos, t\_0, xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(maxCos, t\_0, xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if uy < 0.300000012

              1. Initial program 98.9%

                \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
              2. Taylor expanded in uy around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
              3. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                6. lower-sqrt.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                7. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. Applied rewrites51.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
              5. Taylor expanded in maxCos around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
              6. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                5. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
              7. Applied rewrites98.7%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
              8. Taylor expanded in uy around 0

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\pi}^{2}\right)\right) + 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]
              9. Step-by-step derivation
                1. lower-+.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                3. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                4. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                6. lower-pow.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                7. lower-PI.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                8. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                9. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                10. lower-PI.f3285.9%

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]
              10. Applied rewrites85.9%

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]

              if 0.300000012 < uy

              1. Initial program 98.9%

                \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
              2. Taylor expanded in uy around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
              3. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                6. lower-sqrt.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                7. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. Applied rewrites51.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
              5. Taylor expanded in maxCos around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
              6. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                5. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
              7. Applied rewrites98.7%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
              8. Taylor expanded in yi around 0

                \[\leadsto maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right)} \]
              9. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                6. lower-cos.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                7. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                8. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                9. lower-PI.f3259.1%

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
              10. Applied rewrites59.1%

                \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 15: 85.9% accurate, 2.9× speedup?

            \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
            \[\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]
            (FPCore (xi yi zi ux uy maxCos)
              :precision binary32
              :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                     (and (<= -10000.0 yi) (<= yi 10000.0)))
                                (and (<= -10000.0 zi) (<= zi 10000.0)))
                           (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                      (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                 (and (<= 0.0 maxCos) (<= maxCos 1.0)))
              (fma
             maxCos
             (* ux (* zi (- 1.0 ux)))
             (+
              xi
              (* uy (fma -2.0 (* uy (* xi (pow PI 2.0))) (* 2.0 (* yi PI)))))))
            float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
            	return fmaf(maxCos, (ux * (zi * (1.0f - ux))), (xi + (uy * fmaf(-2.0f, (uy * (xi * powf(((float) M_PI), 2.0f))), (2.0f * (yi * ((float) M_PI)))))));
            }
            
            function code(xi, yi, zi, ux, uy, maxCos)
            	return fma(maxCos, Float32(ux * Float32(zi * Float32(Float32(1.0) - ux))), Float32(xi + Float32(uy * fma(Float32(-2.0), Float32(uy * Float32(xi * (Float32(pi) ^ Float32(2.0)))), Float32(Float32(2.0) * Float32(yi * Float32(pi)))))))
            end
            
            \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right)
            
            Derivation
            1. Initial program 98.9%

              \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
            2. Taylor expanded in uy around 0

              \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
            3. Step-by-step derivation
              1. lower-fma.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              2. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              3. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. lower--.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              5. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              6. lower-sqrt.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              7. lower--.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
            4. Applied rewrites51.6%

              \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
            5. Taylor expanded in maxCos around 0

              \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
            6. Step-by-step derivation
              1. lower-fma.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              2. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              3. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              4. lower--.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              5. lower-fma.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
            7. Applied rewrites98.7%

              \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
            8. Taylor expanded in uy around 0

              \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\pi}^{2}\right)\right) + 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]
            9. Step-by-step derivation
              1. lower-+.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              2. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              3. lower-fma.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              4. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              5. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              6. lower-pow.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              7. lower-PI.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              8. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              9. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
              10. lower-PI.f3285.9%

                \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]
            10. Applied rewrites85.9%

              \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi + uy \cdot \mathsf{fma}\left(-2, uy \cdot \left(xi \cdot {\pi}^{2}\right), 2 \cdot \left(yi \cdot \pi\right)\right)\right) \]
            11. Add Preprocessing

            Alternative 16: 82.0% accurate, 3.0× speedup?

            \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
            \[\mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(uy + uy, yi \cdot \pi, xi\right)\right) \]
            (FPCore (xi yi zi ux uy maxCos)
              :precision binary32
              :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                     (and (<= -10000.0 yi) (<= yi 10000.0)))
                                (and (<= -10000.0 zi) (<= zi 10000.0)))
                           (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                      (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                 (and (<= 0.0 maxCos) (<= maxCos 1.0)))
              (fma
             (- 1.0 ux)
             (* (* zi ux) maxCos)
             (*
              (sqrt
               (fma
                (* (- ux 1.0) maxCos)
                (* (* (* maxCos (- 1.0 ux)) ux) ux)
                1.0))
              (fma (+ uy uy) (* yi PI) xi))))
            float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
            	return fmaf((1.0f - ux), ((zi * ux) * maxCos), (sqrtf(fmaf(((ux - 1.0f) * maxCos), (((maxCos * (1.0f - ux)) * ux) * ux), 1.0f)) * fmaf((uy + uy), (yi * ((float) M_PI)), xi)));
            }
            
            function code(xi, yi, zi, ux, uy, maxCos)
            	return fma(Float32(Float32(1.0) - ux), Float32(Float32(zi * ux) * maxCos), Float32(sqrt(fma(Float32(Float32(ux - Float32(1.0)) * maxCos), Float32(Float32(Float32(maxCos * Float32(Float32(1.0) - ux)) * ux) * ux), Float32(1.0))) * fma(Float32(uy + uy), Float32(yi * Float32(pi)), xi)))
            end
            
            \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(uy + uy, yi \cdot \pi, xi\right)\right)
            
            Derivation
            1. Initial program 98.9%

              \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
            2. Applied rewrites99.0%

              \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
            3. Step-by-step derivation
              1. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right) \cdot zi}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              2. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right)} \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              3. associate-*l*N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{maxCos \cdot \left(ux \cdot zi\right)}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              4. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              5. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              6. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              7. lower-*.f3299.0%

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
            4. Applied rewrites99.0%

              \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
            5. Taylor expanded in uy around 0

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)}\right) \]
            6. Step-by-step derivation
              1. lower-+.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
              2. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
              3. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \color{blue}{\left(yi \cdot \mathsf{PI}\left(\right)\right)}\right)\right)\right) \]
              4. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
              5. lower-PI.f3281.9%

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)\right) \]
            7. Applied rewrites81.9%

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)}\right) \]
            8. Step-by-step derivation
              1. lift-+.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)}\right)\right) \]
              2. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right) + \color{blue}{xi}\right)\right) \]
              3. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right) + xi\right)\right) \]
              4. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right) + xi\right)\right) \]
              5. associate-*r*N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(2 \cdot uy\right) \cdot \left(yi \cdot \pi\right) + xi\right)\right) \]
              6. count-2N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(uy + uy\right) \cdot \left(yi \cdot \pi\right) + xi\right)\right) \]
              7. lift-+.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(uy + uy\right) \cdot \left(yi \cdot \pi\right) + xi\right)\right) \]
              8. lower-fma.f3282.0%

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(uy + uy, \color{blue}{yi \cdot \pi}, xi\right)\right) \]
            9. Applied rewrites82.0%

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(uy + uy, \color{blue}{yi \cdot \pi}, xi\right)\right) \]
            10. Add Preprocessing

            Alternative 17: 82.0% accurate, 3.0× speedup?

            \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
            \[\mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\left(\pi + \pi\right) \cdot uy, yi, xi\right)\right) \]
            (FPCore (xi yi zi ux uy maxCos)
              :precision binary32
              :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                     (and (<= -10000.0 yi) (<= yi 10000.0)))
                                (and (<= -10000.0 zi) (<= zi 10000.0)))
                           (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                      (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                 (and (<= 0.0 maxCos) (<= maxCos 1.0)))
              (fma
             (- 1.0 ux)
             (* (* zi ux) maxCos)
             (*
              (sqrt
               (fma
                (* (- ux 1.0) maxCos)
                (* (* (* maxCos (- 1.0 ux)) ux) ux)
                1.0))
              (fma (* (+ PI PI) uy) yi xi))))
            float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
            	return fmaf((1.0f - ux), ((zi * ux) * maxCos), (sqrtf(fmaf(((ux - 1.0f) * maxCos), (((maxCos * (1.0f - ux)) * ux) * ux), 1.0f)) * fmaf(((((float) M_PI) + ((float) M_PI)) * uy), yi, xi)));
            }
            
            function code(xi, yi, zi, ux, uy, maxCos)
            	return fma(Float32(Float32(1.0) - ux), Float32(Float32(zi * ux) * maxCos), Float32(sqrt(fma(Float32(Float32(ux - Float32(1.0)) * maxCos), Float32(Float32(Float32(maxCos * Float32(Float32(1.0) - ux)) * ux) * ux), Float32(1.0))) * fma(Float32(Float32(Float32(pi) + Float32(pi)) * uy), yi, xi)))
            end
            
            \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\left(\pi + \pi\right) \cdot uy, yi, xi\right)\right)
            
            Derivation
            1. Initial program 98.9%

              \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
            2. Applied rewrites99.0%

              \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
            3. Step-by-step derivation
              1. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right) \cdot zi}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              2. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right)} \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              3. associate-*l*N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{maxCos \cdot \left(ux \cdot zi\right)}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              4. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              5. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              6. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              7. lower-*.f3299.0%

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
            4. Applied rewrites99.0%

              \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
            5. Taylor expanded in uy around 0

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)}\right) \]
            6. Step-by-step derivation
              1. lower-+.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
              2. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
              3. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \color{blue}{\left(yi \cdot \mathsf{PI}\left(\right)\right)}\right)\right)\right) \]
              4. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
              5. lower-PI.f3281.9%

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)\right) \]
            7. Applied rewrites81.9%

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)}\right) \]
            8. Step-by-step derivation
              1. lift-+.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)}\right)\right) \]
              2. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right) + \color{blue}{xi}\right)\right) \]
              3. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right) + xi\right)\right) \]
              4. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right) + xi\right)\right) \]
              5. associate-*r*N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(2 \cdot uy\right) \cdot \left(yi \cdot \pi\right) + xi\right)\right) \]
              6. count-2N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(uy + uy\right) \cdot \left(yi \cdot \pi\right) + xi\right)\right) \]
              7. lift-+.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(uy + uy\right) \cdot \left(yi \cdot \pi\right) + xi\right)\right) \]
              8. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(uy + uy\right) \cdot \left(yi \cdot \pi\right) + xi\right)\right) \]
              9. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(uy + uy\right) \cdot \left(\pi \cdot yi\right) + xi\right)\right) \]
              10. associate-*r*N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(\left(uy + uy\right) \cdot \pi\right) \cdot yi + xi\right)\right) \]
              11. lift-+.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(\left(uy + uy\right) \cdot \pi\right) \cdot yi + xi\right)\right) \]
              12. count-2N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(\left(2 \cdot uy\right) \cdot \pi\right) \cdot yi + xi\right)\right) \]
              13. associate-*r*N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot yi + xi\right)\right) \]
              14. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot yi + xi\right)\right) \]
              15. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot yi + xi\right)\right) \]
              16. lower-fma.f3282.0%

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(2 \cdot \left(uy \cdot \pi\right), \color{blue}{yi}, xi\right)\right) \]
              17. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(2 \cdot \left(uy \cdot \pi\right), yi, xi\right)\right) \]
              18. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(2 \cdot \left(uy \cdot \pi\right), yi, xi\right)\right) \]
              19. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(2 \cdot \left(\pi \cdot uy\right), yi, xi\right)\right) \]
              20. associate-*r*N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\left(2 \cdot \pi\right) \cdot uy, yi, xi\right)\right) \]
              21. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\left(2 \cdot \pi\right) \cdot uy, yi, xi\right)\right) \]
              22. count-2-revN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\left(\pi + \pi\right) \cdot uy, yi, xi\right)\right) \]
              23. lower-+.f3282.0%

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\left(\pi + \pi\right) \cdot uy, yi, xi\right)\right) \]
            9. Applied rewrites82.0%

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\left(\pi + \pi\right) \cdot uy, \color{blue}{yi}, xi\right)\right) \]
            10. Add Preprocessing

            Alternative 18: 81.9% accurate, 3.0× speedup?

            \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
            \[\mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\left(uy + uy\right) \cdot yi, \pi, xi\right)\right) \]
            (FPCore (xi yi zi ux uy maxCos)
              :precision binary32
              :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                     (and (<= -10000.0 yi) (<= yi 10000.0)))
                                (and (<= -10000.0 zi) (<= zi 10000.0)))
                           (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                      (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                 (and (<= 0.0 maxCos) (<= maxCos 1.0)))
              (fma
             (- 1.0 ux)
             (* (* zi ux) maxCos)
             (*
              (sqrt
               (fma
                (* (- ux 1.0) maxCos)
                (* (* (* maxCos (- 1.0 ux)) ux) ux)
                1.0))
              (fma (* (+ uy uy) yi) PI xi))))
            float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
            	return fmaf((1.0f - ux), ((zi * ux) * maxCos), (sqrtf(fmaf(((ux - 1.0f) * maxCos), (((maxCos * (1.0f - ux)) * ux) * ux), 1.0f)) * fmaf(((uy + uy) * yi), ((float) M_PI), xi)));
            }
            
            function code(xi, yi, zi, ux, uy, maxCos)
            	return fma(Float32(Float32(1.0) - ux), Float32(Float32(zi * ux) * maxCos), Float32(sqrt(fma(Float32(Float32(ux - Float32(1.0)) * maxCos), Float32(Float32(Float32(maxCos * Float32(Float32(1.0) - ux)) * ux) * ux), Float32(1.0))) * fma(Float32(Float32(uy + uy) * yi), Float32(pi), xi)))
            end
            
            \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\left(uy + uy\right) \cdot yi, \pi, xi\right)\right)
            
            Derivation
            1. Initial program 98.9%

              \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
            2. Applied rewrites99.0%

              \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
            3. Step-by-step derivation
              1. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right) \cdot zi}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              2. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right)} \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              3. associate-*l*N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{maxCos \cdot \left(ux \cdot zi\right)}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              4. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              5. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              6. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              7. lower-*.f3299.0%

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
            4. Applied rewrites99.0%

              \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
            5. Taylor expanded in uy around 0

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)}\right) \]
            6. Step-by-step derivation
              1. lower-+.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
              2. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
              3. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \color{blue}{\left(yi \cdot \mathsf{PI}\left(\right)\right)}\right)\right)\right) \]
              4. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
              5. lower-PI.f3281.9%

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)\right) \]
            7. Applied rewrites81.9%

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)}\right) \]
            8. Step-by-step derivation
              1. lift-+.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)}\right)\right) \]
              2. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right) + \color{blue}{xi}\right)\right) \]
              3. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right) + xi\right)\right) \]
              4. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right) + xi\right)\right) \]
              5. associate-*r*N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(2 \cdot uy\right) \cdot \left(yi \cdot \pi\right) + xi\right)\right) \]
              6. count-2N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(uy + uy\right) \cdot \left(yi \cdot \pi\right) + xi\right)\right) \]
              7. lift-+.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(uy + uy\right) \cdot \left(yi \cdot \pi\right) + xi\right)\right) \]
              8. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(uy + uy\right) \cdot \left(yi \cdot \pi\right) + xi\right)\right) \]
              9. associate-*r*N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(\left(\left(uy + uy\right) \cdot yi\right) \cdot \pi + xi\right)\right) \]
              10. lower-fma.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\left(uy + uy\right) \cdot yi, \color{blue}{\pi}, xi\right)\right) \]
              11. lower-*.f3281.9%

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\left(uy + uy\right) \cdot yi, \pi, xi\right)\right) \]
            9. Applied rewrites81.9%

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\left(uy + uy\right) \cdot yi, \color{blue}{\pi}, xi\right)\right) \]
            10. Add Preprocessing

            Alternative 19: 81.8% accurate, 3.3× speedup?

            \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
            \[\mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(maxCos \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)\right) \]
            (FPCore (xi yi zi ux uy maxCos)
              :precision binary32
              :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                     (and (<= -10000.0 yi) (<= yi 10000.0)))
                                (and (<= -10000.0 zi) (<= zi 10000.0)))
                           (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                      (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                 (and (<= 0.0 maxCos) (<= maxCos 1.0)))
              (fma
             (- 1.0 ux)
             (* (* zi ux) maxCos)
             (*
              (sqrt (fma (* (- ux 1.0) maxCos) (* (* maxCos ux) ux) 1.0))
              (+ xi (* 2.0 (* uy (* yi PI)))))))
            float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
            	return fmaf((1.0f - ux), ((zi * ux) * maxCos), (sqrtf(fmaf(((ux - 1.0f) * maxCos), ((maxCos * ux) * ux), 1.0f)) * (xi + (2.0f * (uy * (yi * ((float) M_PI)))))));
            }
            
            function code(xi, yi, zi, ux, uy, maxCos)
            	return fma(Float32(Float32(1.0) - ux), Float32(Float32(zi * ux) * maxCos), Float32(sqrt(fma(Float32(Float32(ux - Float32(1.0)) * maxCos), Float32(Float32(maxCos * ux) * ux), Float32(1.0))) * Float32(xi + Float32(Float32(2.0) * Float32(uy * Float32(yi * Float32(pi)))))))
            end
            
            \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(maxCos \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)\right)
            
            Derivation
            1. Initial program 98.9%

              \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
            2. Applied rewrites99.0%

              \[\leadsto \color{blue}{\mathsf{fma}\left(1 - ux, \left(maxCos \cdot ux\right) \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right)} \]
            3. Step-by-step derivation
              1. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right) \cdot zi}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              2. lift-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(maxCos \cdot ux\right)} \cdot zi, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              3. associate-*l*N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{maxCos \cdot \left(ux \cdot zi\right)}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              4. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              5. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(ux \cdot zi\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              6. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
              7. lower-*.f3299.0%

                \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right)} \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
            4. Applied rewrites99.0%

              \[\leadsto \mathsf{fma}\left(1 - ux, \color{blue}{\left(zi \cdot ux\right) \cdot maxCos}, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(uy + uy\right)\right), yi, \cos \left(\pi \cdot \left(uy + uy\right)\right) \cdot xi\right)\right) \]
            5. Taylor expanded in uy around 0

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)}\right) \]
            6. Step-by-step derivation
              1. lower-+.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
              2. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
              3. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \color{blue}{\left(yi \cdot \mathsf{PI}\left(\right)\right)}\right)\right)\right) \]
              4. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
              5. lower-PI.f3281.9%

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)\right) \]
            7. Applied rewrites81.9%

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right) \cdot ux, 1\right)} \cdot \color{blue}{\left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)}\right) \]
            8. Taylor expanded in ux around 0

              \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\color{blue}{maxCos} \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)\right) \]
            9. Step-by-step derivation
              1. Applied rewrites81.8%

                \[\leadsto \mathsf{fma}\left(1 - ux, \left(zi \cdot ux\right) \cdot maxCos, \sqrt{\mathsf{fma}\left(\left(ux - 1\right) \cdot maxCos, \left(\color{blue}{maxCos} \cdot ux\right) \cdot ux, 1\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right)\right)\right) \]
              2. Add Preprocessing

              Alternative 20: 81.8% accurate, 6.1× speedup?

              \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
              \[xi + \mathsf{fma}\left(2, uy \cdot \left(yi \cdot \pi\right), maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) \]
              (FPCore (xi yi zi ux uy maxCos)
                :precision binary32
                :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                       (and (<= -10000.0 yi) (<= yi 10000.0)))
                                  (and (<= -10000.0 zi) (<= zi 10000.0)))
                             (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                        (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                   (and (<= 0.0 maxCos) (<= maxCos 1.0)))
                (+ xi (fma 2.0 (* uy (* yi PI)) (* maxCos (* ux (* zi (- 1.0 ux)))))))
              float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
              	return xi + fmaf(2.0f, (uy * (yi * ((float) M_PI))), (maxCos * (ux * (zi * (1.0f - ux)))));
              }
              
              function code(xi, yi, zi, ux, uy, maxCos)
              	return Float32(xi + fma(Float32(2.0), Float32(uy * Float32(yi * Float32(pi))), Float32(maxCos * Float32(ux * Float32(zi * Float32(Float32(1.0) - ux))))))
              end
              
              xi + \mathsf{fma}\left(2, uy \cdot \left(yi \cdot \pi\right), maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)
              
              Derivation
              1. Initial program 98.9%

                \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
              2. Taylor expanded in uy around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
              3. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                6. lower-sqrt.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                7. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. Applied rewrites51.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
              5. Taylor expanded in maxCos around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)} \]
              6. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                5. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
              7. Applied rewrites98.7%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), \mathsf{fma}\left(xi, \cos \left(2 \cdot \left(uy \cdot \pi\right)\right), yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
              8. Taylor expanded in uy around 0

                \[\leadsto xi + \color{blue}{\left(2 \cdot \left(uy \cdot \left(yi \cdot \pi\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
              9. Step-by-step derivation
                1. lower-+.f32N/A

                  \[\leadsto xi + \left(2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)}\right) \]
                2. lower-fma.f32N/A

                  \[\leadsto xi + \mathsf{fma}\left(2, uy \cdot \color{blue}{\left(yi \cdot \mathsf{PI}\left(\right)\right)}, maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) \]
                3. lower-*.f32N/A

                  \[\leadsto xi + \mathsf{fma}\left(2, uy \cdot \left(yi \cdot \color{blue}{\mathsf{PI}\left(\right)}\right), maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) \]
                4. lower-*.f32N/A

                  \[\leadsto xi + \mathsf{fma}\left(2, uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right), maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) \]
                5. lower-PI.f32N/A

                  \[\leadsto xi + \mathsf{fma}\left(2, uy \cdot \left(yi \cdot \pi\right), maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) \]
                6. lower-*.f32N/A

                  \[\leadsto xi + \mathsf{fma}\left(2, uy \cdot \left(yi \cdot \pi\right), maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) \]
                7. lower-*.f32N/A

                  \[\leadsto xi + \mathsf{fma}\left(2, uy \cdot \left(yi \cdot \pi\right), maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) \]
                8. lower-*.f32N/A

                  \[\leadsto xi + \mathsf{fma}\left(2, uy \cdot \left(yi \cdot \pi\right), maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) \]
                9. lower--.f3281.8%

                  \[\leadsto xi + \mathsf{fma}\left(2, uy \cdot \left(yi \cdot \pi\right), maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) \]
              10. Applied rewrites81.8%

                \[\leadsto xi + \color{blue}{\mathsf{fma}\left(2, uy \cdot \left(yi \cdot \pi\right), maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
              11. Add Preprocessing

              Alternative 21: 51.6% accurate, 10.5× speedup?

              \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
              \[xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) \]
              (FPCore (xi yi zi ux uy maxCos)
                :precision binary32
                :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                       (and (<= -10000.0 yi) (<= yi 10000.0)))
                                  (and (<= -10000.0 zi) (<= zi 10000.0)))
                             (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                        (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                   (and (<= 0.0 maxCos) (<= maxCos 1.0)))
                (+ xi (* maxCos (* ux (* zi (- 1.0 ux))))))
              float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
              	return xi + (maxCos * (ux * (zi * (1.0f - ux))));
              }
              
              real(4) function code(xi, yi, zi, ux, uy, maxcos)
              use fmin_fmax_functions
                  real(4), intent (in) :: xi
                  real(4), intent (in) :: yi
                  real(4), intent (in) :: zi
                  real(4), intent (in) :: ux
                  real(4), intent (in) :: uy
                  real(4), intent (in) :: maxcos
                  code = xi + (maxcos * (ux * (zi * (1.0e0 - ux))))
              end function
              
              function code(xi, yi, zi, ux, uy, maxCos)
              	return Float32(xi + Float32(maxCos * Float32(ux * Float32(zi * Float32(Float32(1.0) - ux)))))
              end
              
              function tmp = code(xi, yi, zi, ux, uy, maxCos)
              	tmp = xi + (maxCos * (ux * (zi * (single(1.0) - ux))));
              end
              
              xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)
              
              Derivation
              1. Initial program 98.9%

                \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
              2. Taylor expanded in uy around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
              3. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                6. lower-sqrt.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                7. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. Applied rewrites51.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
              5. Taylor expanded in ux around 0

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
              6. Step-by-step derivation
                1. lower-+.f32N/A

                  \[\leadsto xi + maxCos \cdot \color{blue}{\left(ux \cdot zi\right)} \]
                2. lower-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
                3. lower-*.f3249.4%

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot zi\right) \]
              7. Applied rewrites49.4%

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
              8. Taylor expanded in maxCos around 0

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
              9. Step-by-step derivation
                1. lower-+.f32N/A

                  \[\leadsto xi + maxCos \cdot \color{blue}{\left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
                2. lower-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}\right) \]
                3. lower-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right)\right) \]
                4. lower-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right)\right) \]
                5. lower--.f3251.6%

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) \]
              10. Applied rewrites51.6%

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
              11. Add Preprocessing

              Alternative 22: 49.4% accurate, 16.6× speedup?

              \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
              \[xi + \left(zi \cdot maxCos\right) \cdot ux \]
              (FPCore (xi yi zi ux uy maxCos)
                :precision binary32
                :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                       (and (<= -10000.0 yi) (<= yi 10000.0)))
                                  (and (<= -10000.0 zi) (<= zi 10000.0)))
                             (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                        (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                   (and (<= 0.0 maxCos) (<= maxCos 1.0)))
                (+ xi (* (* zi maxCos) ux)))
              float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
              	return xi + ((zi * maxCos) * ux);
              }
              
              real(4) function code(xi, yi, zi, ux, uy, maxcos)
              use fmin_fmax_functions
                  real(4), intent (in) :: xi
                  real(4), intent (in) :: yi
                  real(4), intent (in) :: zi
                  real(4), intent (in) :: ux
                  real(4), intent (in) :: uy
                  real(4), intent (in) :: maxcos
                  code = xi + ((zi * maxcos) * ux)
              end function
              
              function code(xi, yi, zi, ux, uy, maxCos)
              	return Float32(xi + Float32(Float32(zi * maxCos) * ux))
              end
              
              function tmp = code(xi, yi, zi, ux, uy, maxCos)
              	tmp = xi + ((zi * maxCos) * ux);
              end
              
              xi + \left(zi \cdot maxCos\right) \cdot ux
              
              Derivation
              1. Initial program 98.9%

                \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
              2. Taylor expanded in uy around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
              3. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                6. lower-sqrt.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                7. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. Applied rewrites51.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
              5. Taylor expanded in ux around 0

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
              6. Step-by-step derivation
                1. lower-+.f32N/A

                  \[\leadsto xi + maxCos \cdot \color{blue}{\left(ux \cdot zi\right)} \]
                2. lower-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
                3. lower-*.f3249.4%

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot zi\right) \]
              7. Applied rewrites49.4%

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
              8. Step-by-step derivation
                1. lift-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
                2. *-commutativeN/A

                  \[\leadsto xi + \left(ux \cdot zi\right) \cdot maxCos \]
                3. lift-*.f32N/A

                  \[\leadsto xi + \left(ux \cdot zi\right) \cdot maxCos \]
                4. *-commutativeN/A

                  \[\leadsto xi + \left(zi \cdot ux\right) \cdot maxCos \]
                5. associate-*l*N/A

                  \[\leadsto xi + zi \cdot \left(ux \cdot \color{blue}{maxCos}\right) \]
                6. *-commutativeN/A

                  \[\leadsto xi + zi \cdot \left(maxCos \cdot ux\right) \]
                7. associate-*r*N/A

                  \[\leadsto xi + \left(zi \cdot maxCos\right) \cdot ux \]
                8. lower-*.f32N/A

                  \[\leadsto xi + \left(zi \cdot maxCos\right) \cdot ux \]
                9. lower-*.f3249.4%

                  \[\leadsto xi + \left(zi \cdot maxCos\right) \cdot ux \]
              9. Applied rewrites49.4%

                \[\leadsto xi + \left(zi \cdot maxCos\right) \cdot ux \]
              10. Add Preprocessing

              Alternative 23: 49.4% accurate, 17.7× speedup?

              \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
              \[\mathsf{fma}\left(zi \cdot maxCos, ux, xi\right) \]
              (FPCore (xi yi zi ux uy maxCos)
                :precision binary32
                :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                       (and (<= -10000.0 yi) (<= yi 10000.0)))
                                  (and (<= -10000.0 zi) (<= zi 10000.0)))
                             (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                        (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                   (and (<= 0.0 maxCos) (<= maxCos 1.0)))
                (fma (* zi maxCos) ux xi))
              float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
              	return fmaf((zi * maxCos), ux, xi);
              }
              
              function code(xi, yi, zi, ux, uy, maxCos)
              	return fma(Float32(zi * maxCos), ux, xi)
              end
              
              \mathsf{fma}\left(zi \cdot maxCos, ux, xi\right)
              
              Derivation
              1. Initial program 98.9%

                \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
              2. Taylor expanded in uy around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
              3. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                6. lower-sqrt.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                7. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. Applied rewrites51.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
              5. Taylor expanded in ux around 0

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
              6. Step-by-step derivation
                1. lower-+.f32N/A

                  \[\leadsto xi + maxCos \cdot \color{blue}{\left(ux \cdot zi\right)} \]
                2. lower-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
                3. lower-*.f3249.4%

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot zi\right) \]
              7. Applied rewrites49.4%

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
              8. Step-by-step derivation
                1. lift-+.f32N/A

                  \[\leadsto xi + maxCos \cdot \color{blue}{\left(ux \cdot zi\right)} \]
                2. lift-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
                3. lift-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot zi\right) \]
                4. associate-*l*N/A

                  \[\leadsto xi + \left(maxCos \cdot ux\right) \cdot zi \]
                5. lift-*.f32N/A

                  \[\leadsto xi + \left(maxCos \cdot ux\right) \cdot zi \]
                6. lift-*.f32N/A

                  \[\leadsto xi + \left(maxCos \cdot ux\right) \cdot zi \]
                7. +-commutativeN/A

                  \[\leadsto \left(maxCos \cdot ux\right) \cdot zi + xi \]
                8. lift-*.f32N/A

                  \[\leadsto \left(maxCos \cdot ux\right) \cdot zi + xi \]
                9. *-commutativeN/A

                  \[\leadsto zi \cdot \left(maxCos \cdot ux\right) + xi \]
                10. lift-*.f32N/A

                  \[\leadsto zi \cdot \left(maxCos \cdot ux\right) + xi \]
                11. associate-*r*N/A

                  \[\leadsto \left(zi \cdot maxCos\right) \cdot ux + xi \]
                12. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(zi \cdot maxCos, ux, xi\right) \]
                13. lower-*.f3249.4%

                  \[\leadsto \mathsf{fma}\left(zi \cdot maxCos, ux, xi\right) \]
              9. Applied rewrites49.4%

                \[\leadsto \mathsf{fma}\left(zi \cdot maxCos, ux, xi\right) \]
              10. Add Preprocessing

              Alternative 24: 49.4% accurate, 17.7× speedup?

              \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
              \[\mathsf{fma}\left(maxCos \cdot ux, zi, xi\right) \]
              (FPCore (xi yi zi ux uy maxCos)
                :precision binary32
                :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                       (and (<= -10000.0 yi) (<= yi 10000.0)))
                                  (and (<= -10000.0 zi) (<= zi 10000.0)))
                             (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                        (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                   (and (<= 0.0 maxCos) (<= maxCos 1.0)))
                (fma (* maxCos ux) zi xi))
              float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
              	return fmaf((maxCos * ux), zi, xi);
              }
              
              function code(xi, yi, zi, ux, uy, maxCos)
              	return fma(Float32(maxCos * ux), zi, xi)
              end
              
              \mathsf{fma}\left(maxCos \cdot ux, zi, xi\right)
              
              Derivation
              1. Initial program 98.9%

                \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
              2. Taylor expanded in uy around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
              3. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                6. lower-sqrt.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                7. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. Applied rewrites51.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
              5. Taylor expanded in ux around 0

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
              6. Step-by-step derivation
                1. lower-+.f32N/A

                  \[\leadsto xi + maxCos \cdot \color{blue}{\left(ux \cdot zi\right)} \]
                2. lower-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
                3. lower-*.f3249.4%

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot zi\right) \]
              7. Applied rewrites49.4%

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
              8. Step-by-step derivation
                1. lift-+.f32N/A

                  \[\leadsto xi + maxCos \cdot \color{blue}{\left(ux \cdot zi\right)} \]
                2. lift-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
                3. lift-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot zi\right) \]
                4. associate-*l*N/A

                  \[\leadsto xi + \left(maxCos \cdot ux\right) \cdot zi \]
                5. lift-*.f32N/A

                  \[\leadsto xi + \left(maxCos \cdot ux\right) \cdot zi \]
                6. lift-*.f32N/A

                  \[\leadsto xi + \left(maxCos \cdot ux\right) \cdot zi \]
                7. +-commutativeN/A

                  \[\leadsto \left(maxCos \cdot ux\right) \cdot zi + xi \]
                8. lift-*.f32N/A

                  \[\leadsto \left(maxCos \cdot ux\right) \cdot zi + xi \]
                9. lower-fma.f3249.4%

                  \[\leadsto \mathsf{fma}\left(maxCos \cdot ux, zi, xi\right) \]
              9. Applied rewrites49.4%

                \[\leadsto \mathsf{fma}\left(maxCos \cdot ux, zi, xi\right) \]
              10. Add Preprocessing

              Alternative 25: 12.1% accurate, 22.8× speedup?

              \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
              \[\left(maxCos \cdot zi\right) \cdot ux \]
              (FPCore (xi yi zi ux uy maxCos)
                :precision binary32
                :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                       (and (<= -10000.0 yi) (<= yi 10000.0)))
                                  (and (<= -10000.0 zi) (<= zi 10000.0)))
                             (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                        (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                   (and (<= 0.0 maxCos) (<= maxCos 1.0)))
                (* (* maxCos zi) ux))
              float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
              	return (maxCos * zi) * ux;
              }
              
              real(4) function code(xi, yi, zi, ux, uy, maxcos)
              use fmin_fmax_functions
                  real(4), intent (in) :: xi
                  real(4), intent (in) :: yi
                  real(4), intent (in) :: zi
                  real(4), intent (in) :: ux
                  real(4), intent (in) :: uy
                  real(4), intent (in) :: maxcos
                  code = (maxcos * zi) * ux
              end function
              
              function code(xi, yi, zi, ux, uy, maxCos)
              	return Float32(Float32(maxCos * zi) * ux)
              end
              
              function tmp = code(xi, yi, zi, ux, uy, maxCos)
              	tmp = (maxCos * zi) * ux;
              end
              
              \left(maxCos \cdot zi\right) \cdot ux
              
              Derivation
              1. Initial program 98.9%

                \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
              2. Taylor expanded in uy around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
              3. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                6. lower-sqrt.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                7. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. Applied rewrites51.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
              5. Taylor expanded in ux around 0

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
              6. Step-by-step derivation
                1. lower-+.f32N/A

                  \[\leadsto xi + maxCos \cdot \color{blue}{\left(ux \cdot zi\right)} \]
                2. lower-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
                3. lower-*.f3249.4%

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot zi\right) \]
              7. Applied rewrites49.4%

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
              8. Taylor expanded in xi around 0

                \[\leadsto maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
              9. Step-by-step derivation
                1. lower-*.f32N/A

                  \[\leadsto maxCos \cdot \left(ux \cdot zi\right) \]
                2. lower-*.f3212.1%

                  \[\leadsto maxCos \cdot \left(ux \cdot zi\right) \]
              10. Applied rewrites12.1%

                \[\leadsto maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
              11. Step-by-step derivation
                1. lift-*.f32N/A

                  \[\leadsto maxCos \cdot \left(ux \cdot zi\right) \]
                2. lift-*.f32N/A

                  \[\leadsto maxCos \cdot \left(ux \cdot zi\right) \]
                3. *-commutativeN/A

                  \[\leadsto maxCos \cdot \left(zi \cdot ux\right) \]
                4. associate-*r*N/A

                  \[\leadsto \left(maxCos \cdot zi\right) \cdot ux \]
                5. lower-*.f32N/A

                  \[\leadsto \left(maxCos \cdot zi\right) \cdot ux \]
                6. lower-*.f3212.1%

                  \[\leadsto \left(maxCos \cdot zi\right) \cdot ux \]
              12. Applied rewrites12.1%

                \[\leadsto \left(maxCos \cdot zi\right) \cdot ux \]
              13. Add Preprocessing

              Alternative 26: 12.1% accurate, 22.8× speedup?

              \[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\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)\]
              \[maxCos \cdot \left(ux \cdot zi\right) \]
              (FPCore (xi yi zi ux uy maxCos)
                :precision binary32
                :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0))
                                       (and (<= -10000.0 yi) (<= yi 10000.0)))
                                  (and (<= -10000.0 zi) (<= zi 10000.0)))
                             (and (<= 2.328306437e-10 ux) (<= ux 1.0)))
                        (and (<= 2.328306437e-10 uy) (<= uy 1.0)))
                   (and (<= 0.0 maxCos) (<= maxCos 1.0)))
                (* maxCos (* ux zi)))
              float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
              	return maxCos * (ux * zi);
              }
              
              real(4) function code(xi, yi, zi, ux, uy, maxcos)
              use fmin_fmax_functions
                  real(4), intent (in) :: xi
                  real(4), intent (in) :: yi
                  real(4), intent (in) :: zi
                  real(4), intent (in) :: ux
                  real(4), intent (in) :: uy
                  real(4), intent (in) :: maxcos
                  code = maxcos * (ux * zi)
              end function
              
              function code(xi, yi, zi, ux, uy, maxCos)
              	return Float32(maxCos * Float32(ux * zi))
              end
              
              function tmp = code(xi, yi, zi, ux, uy, maxCos)
              	tmp = maxCos * (ux * zi);
              end
              
              maxCos \cdot \left(ux \cdot zi\right)
              
              Derivation
              1. Initial program 98.9%

                \[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi \]
              2. Taylor expanded in uy around 0

                \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}} \]
              3. Step-by-step derivation
                1. lower-fma.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, \color{blue}{ux \cdot \left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                2. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \color{blue}{\left(zi \cdot \left(1 - ux\right)\right)}, xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                3. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \color{blue}{\left(1 - ux\right)}\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                4. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - \color{blue}{ux}\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                5. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                6. lower-sqrt.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
                7. lower--.f32N/A

                  \[\leadsto \mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right) \]
              4. Applied rewrites51.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(maxCos, ux \cdot \left(zi \cdot \left(1 - ux\right)\right), xi \cdot \sqrt{1 - {maxCos}^{2} \cdot \left({ux}^{2} \cdot {\left(1 - ux\right)}^{2}\right)}\right)} \]
              5. Taylor expanded in ux around 0

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
              6. Step-by-step derivation
                1. lower-+.f32N/A

                  \[\leadsto xi + maxCos \cdot \color{blue}{\left(ux \cdot zi\right)} \]
                2. lower-*.f32N/A

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
                3. lower-*.f3249.4%

                  \[\leadsto xi + maxCos \cdot \left(ux \cdot zi\right) \]
              7. Applied rewrites49.4%

                \[\leadsto xi + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
              8. Taylor expanded in xi around 0

                \[\leadsto maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
              9. Step-by-step derivation
                1. lower-*.f32N/A

                  \[\leadsto maxCos \cdot \left(ux \cdot zi\right) \]
                2. lower-*.f3212.1%

                  \[\leadsto maxCos \cdot \left(ux \cdot zi\right) \]
              10. Applied rewrites12.1%

                \[\leadsto maxCos \cdot \left(ux \cdot \color{blue}{zi}\right) \]
              11. Add Preprocessing

              Reproduce

              ?
              herbie shell --seed 2025356 
              (FPCore (xi yi zi ux uy maxCos)
                :name "UniformSampleCone 2"
                :precision binary32
                :pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0)) (and (<= -10000.0 yi) (<= yi 10000.0))) (and (<= -10000.0 zi) (<= zi 10000.0))) (and (<= 2.328306437e-10 ux) (<= ux 1.0))) (and (<= 2.328306437e-10 uy) (<= uy 1.0))) (and (<= 0.0 maxCos) (<= maxCos 1.0)))
                (+ (+ (* (* (cos (* (* uy 2.0) PI)) (sqrt (- 1.0 (* (* (* (- 1.0 ux) maxCos) ux) (* (* (- 1.0 ux) maxCos) ux))))) xi) (* (* (sin (* (* uy 2.0) PI)) (sqrt (- 1.0 (* (* (* (- 1.0 ux) maxCos) ux) (* (* (- 1.0 ux) maxCos) ux))))) yi)) (* (* (* (- 1.0 ux) maxCos) ux) zi)))