Average Error: 0.2 → 0.2
Time: 24.3s
Precision: 64
\[\left(0 \le \alpha \land \alpha \le 1\right) \land \left(0 \le NdotH \land NdotH \le 1\right)\]
\[\frac{{\alpha}^{2}}{\pi \cdot {\left({NdotH}^{2} \cdot \left({\alpha}^{2} - 1\right) + 1\right)}^{2}}\]
\[\frac{{\alpha}^{2}}{{\left(\left({\alpha}^{2} - 1\right) \cdot {NdotH}^{2} + 1\right)}^{2} \cdot \pi}\]
\frac{{\alpha}^{2}}{\pi \cdot {\left({NdotH}^{2} \cdot \left({\alpha}^{2} - 1\right) + 1\right)}^{2}}
\frac{{\alpha}^{2}}{{\left(\left({\alpha}^{2} - 1\right) \cdot {NdotH}^{2} + 1\right)}^{2} \cdot \pi}
double f(double alpha, double NdotH) {
        double r16099041 = alpha;
        double r16099042 = 2.0;
        double r16099043 = pow(r16099041, r16099042);
        double r16099044 = atan2(1.0, 0.0);
        double r16099045 = NdotH;
        double r16099046 = pow(r16099045, r16099042);
        double r16099047 = 1.0;
        double r16099048 = r16099043 - r16099047;
        double r16099049 = r16099046 * r16099048;
        double r16099050 = r16099049 + r16099047;
        double r16099051 = pow(r16099050, r16099042);
        double r16099052 = r16099044 * r16099051;
        double r16099053 = r16099043 / r16099052;
        return r16099053;
}

double f(double alpha, double NdotH) {
        double r16099054 = alpha;
        double r16099055 = 2.0;
        double r16099056 = pow(r16099054, r16099055);
        double r16099057 = 1.0;
        double r16099058 = r16099056 - r16099057;
        double r16099059 = NdotH;
        double r16099060 = pow(r16099059, r16099055);
        double r16099061 = r16099058 * r16099060;
        double r16099062 = r16099061 + r16099057;
        double r16099063 = pow(r16099062, r16099055);
        double r16099064 = atan2(1.0, 0.0);
        double r16099065 = r16099063 * r16099064;
        double r16099066 = r16099056 / r16099065;
        return r16099066;
}

Error

Bits error versus alpha

Bits error versus NdotH

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[\frac{{\alpha}^{2}}{\pi \cdot {\left({NdotH}^{2} \cdot \left({\alpha}^{2} - 1\right) + 1\right)}^{2}}\]
  2. Final simplification0.2

    \[\leadsto \frac{{\alpha}^{2}}{{\left(\left({\alpha}^{2} - 1\right) \cdot {NdotH}^{2} + 1\right)}^{2} \cdot \pi}\]

Reproduce

herbie shell --seed 1 
(FPCore (alpha NdotH)
  :name "pow(alpha,2)/(PI*pow(pow(NdotH, 2)*(pow(alpha,2)-1)+1,2))"
  :pre (and (and (<= 0 alpha) (<= alpha 1)) (and (<= 0 NdotH) (<= NdotH 1)))
  (/ (pow alpha 2) (* PI (pow (+ (* (pow NdotH 2) (- (pow alpha 2) 1)) 1) 2))))