Average Error: 0.5 → 0.5
Time: 14.5s
Precision: binary32
\[cosTheta_i > 0.9999 \land cosTheta_i \leq 1 \land 2.328306437 \cdot 10^{-10} \leq u1 \land u1 \leq 1 \land 2.328306437 \cdot 10^{-10} \leq u2 \land u2 \leq 1\]
\[\sqrt{\frac{u1}{1 - u1}} \cdot \sin \left(6.28318530718 \cdot u2\right)\]
\[\sqrt{\sqrt[3]{{\left(\frac{u1}{1 - u1}\right)}^{3}}} \cdot \sin \left(\sqrt{\sqrt{6.28318530718}} \cdot \left(u2 \cdot {\left(\sqrt{6.28318530718}\right)}^{1.5}\right)\right)\]
\sqrt{\frac{u1}{1 - u1}} \cdot \sin \left(6.28318530718 \cdot u2\right)
\sqrt{\sqrt[3]{{\left(\frac{u1}{1 - u1}\right)}^{3}}} \cdot \sin \left(\sqrt{\sqrt{6.28318530718}} \cdot \left(u2 \cdot {\left(\sqrt{6.28318530718}\right)}^{1.5}\right)\right)
(FPCore (cosTheta_i u1 u2)
 :precision binary32
 (* (sqrt (/ u1 (- 1.0 u1))) (sin (* 6.28318530718 u2))))
(FPCore (cosTheta_i u1 u2)
 :precision binary32
 (*
  (sqrt (cbrt (pow (/ u1 (- 1.0 u1)) 3.0)))
  (sin (* (sqrt (sqrt 6.28318530718)) (* u2 (pow (sqrt 6.28318530718) 1.5))))))
float code(float cosTheta_i, float u1, float u2) {
	return sqrtf(u1 / (1.0f - u1)) * sinf(6.28318530718f * u2);
}
float code(float cosTheta_i, float u1, float u2) {
	return sqrtf(cbrtf(powf((u1 / (1.0f - u1)), 3.0f))) * sinf(sqrtf(sqrtf(6.28318530718f)) * (u2 * powf(sqrtf(6.28318530718f), 1.5f)));
}

Error

Bits error versus cosTheta_i

Bits error versus u1

Bits error versus u2

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.5

    \[\sqrt{\frac{u1}{1 - u1}} \cdot \sin \left(6.28318530718 \cdot u2\right)\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt_binary320.5

    \[\leadsto \sqrt{\frac{u1}{1 - u1}} \cdot \sin \left(\color{blue}{\left(\sqrt{6.28318530718} \cdot \sqrt{6.28318530718}\right)} \cdot u2\right)\]
  4. Applied associate-*l*_binary320.5

    \[\leadsto \sqrt{\frac{u1}{1 - u1}} \cdot \sin \color{blue}{\left(\sqrt{6.28318530718} \cdot \left(\sqrt{6.28318530718} \cdot u2\right)\right)}\]
  5. Simplified0.5

    \[\leadsto \sqrt{\frac{u1}{1 - u1}} \cdot \sin \left(\sqrt{6.28318530718} \cdot \color{blue}{\left(u2 \cdot \sqrt{6.28318530718}\right)}\right)\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt_binary320.5

    \[\leadsto \sqrt{\frac{u1}{1 - u1}} \cdot \sin \left(\color{blue}{\left(\sqrt{\sqrt{6.28318530718}} \cdot \sqrt{\sqrt{6.28318530718}}\right)} \cdot \left(u2 \cdot \sqrt{6.28318530718}\right)\right)\]
  8. Applied associate-*l*_binary320.6

    \[\leadsto \sqrt{\frac{u1}{1 - u1}} \cdot \sin \color{blue}{\left(\sqrt{\sqrt{6.28318530718}} \cdot \left(\sqrt{\sqrt{6.28318530718}} \cdot \left(u2 \cdot \sqrt{6.28318530718}\right)\right)\right)}\]
  9. Simplified0.5

    \[\leadsto \sqrt{\frac{u1}{1 - u1}} \cdot \sin \left(\sqrt{\sqrt{6.28318530718}} \cdot \color{blue}{\left(u2 \cdot {\left(\sqrt{6.28318530718}\right)}^{1.5}\right)}\right)\]
  10. Using strategy rm
  11. Applied add-cbrt-cube_binary320.5

    \[\leadsto \sqrt{\color{blue}{\sqrt[3]{\left(\frac{u1}{1 - u1} \cdot \frac{u1}{1 - u1}\right) \cdot \frac{u1}{1 - u1}}}} \cdot \sin \left(\sqrt{\sqrt{6.28318530718}} \cdot \left(u2 \cdot {\left(\sqrt{6.28318530718}\right)}^{1.5}\right)\right)\]
  12. Simplified0.5

    \[\leadsto \sqrt{\sqrt[3]{\color{blue}{{\left(\frac{u1}{1 - u1}\right)}^{3}}}} \cdot \sin \left(\sqrt{\sqrt{6.28318530718}} \cdot \left(u2 \cdot {\left(\sqrt{6.28318530718}\right)}^{1.5}\right)\right)\]
  13. Final simplification0.5

    \[\leadsto \sqrt{\sqrt[3]{{\left(\frac{u1}{1 - u1}\right)}^{3}}} \cdot \sin \left(\sqrt{\sqrt{6.28318530718}} \cdot \left(u2 \cdot {\left(\sqrt{6.28318530718}\right)}^{1.5}\right)\right)\]

Reproduce

herbie shell --seed 2021173 
(FPCore (cosTheta_i u1 u2)
  :name "Trowbridge-Reitz Sample, near normal, slope_y"
  :precision binary32
  :pre (and (> cosTheta_i 0.9999) (<= cosTheta_i 1.0) (<= 2.328306437e-10 u1 1.0) (<= 2.328306437e-10 u2 1.0))
  (* (sqrt (/ u1 (- 1.0 u1))) (sin (* 6.28318530718 u2))))