Average Error: 13.7 → 13.7
Time: 38.0s
Precision: 64
$\sin^{-1} \left(\sqrt{\left(\left(X \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(X \cdot \sin \left(\frac{a}{2}\right)\right) + \left(Y \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(Y \cdot \sin \left(\frac{a}{2}\right)\right)\right) + \left(Z \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(Z \cdot \sin \left(\frac{a}{2}\right)\right)}\right)$
$\sin^{-1} \left(\sqrt{\left(\left(X \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(X \cdot \sin \left(\frac{a}{2}\right)\right) + \left(Y \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(Y \cdot \sin \left(\frac{a}{2}\right)\right)\right) + \left(\left(Z \cdot \sin \left(\frac{a}{2}\right)\right) \cdot Z\right) \cdot \sin \left(\frac{a}{2}\right)}\right)$
\sin^{-1} \left(\sqrt{\left(\left(X \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(X \cdot \sin \left(\frac{a}{2}\right)\right) + \left(Y \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(Y \cdot \sin \left(\frac{a}{2}\right)\right)\right) + \left(Z \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(Z \cdot \sin \left(\frac{a}{2}\right)\right)}\right)
\sin^{-1} \left(\sqrt{\left(\left(X \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(X \cdot \sin \left(\frac{a}{2}\right)\right) + \left(Y \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(Y \cdot \sin \left(\frac{a}{2}\right)\right)\right) + \left(\left(Z \cdot \sin \left(\frac{a}{2}\right)\right) \cdot Z\right) \cdot \sin \left(\frac{a}{2}\right)}\right)
double f(double X, double a, double Y, double Z) {
double r308581 = X;
double r308582 = a;
double r308583 = 2.0;
double r308584 = r308582 / r308583;
double r308585 = sin(r308584);
double r308586 = r308581 * r308585;
double r308587 = r308586 * r308586;
double r308588 = Y;
double r308589 = r308588 * r308585;
double r308590 = r308589 * r308589;
double r308591 = r308587 + r308590;
double r308592 = Z;
double r308593 = r308592 * r308585;
double r308594 = r308593 * r308593;
double r308595 = r308591 + r308594;
double r308596 = sqrt(r308595);
double r308597 = asin(r308596);
return r308597;
}


double f(double X, double a, double Y, double Z) {
double r308598 = X;
double r308599 = a;
double r308600 = 2.0;
double r308601 = r308599 / r308600;
double r308602 = sin(r308601);
double r308603 = r308598 * r308602;
double r308604 = r308603 * r308603;
double r308605 = Y;
double r308606 = r308605 * r308602;
double r308607 = r308606 * r308606;
double r308608 = r308604 + r308607;
double r308609 = Z;
double r308610 = r308609 * r308602;
double r308611 = r308610 * r308609;
double r308612 = r308611 * r308602;
double r308613 = r308608 + r308612;
double r308614 = sqrt(r308613);
double r308615 = asin(r308614);
return r308615;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 13.7

$\sin^{-1} \left(\sqrt{\left(\left(X \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(X \cdot \sin \left(\frac{a}{2}\right)\right) + \left(Y \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(Y \cdot \sin \left(\frac{a}{2}\right)\right)\right) + \left(Z \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(Z \cdot \sin \left(\frac{a}{2}\right)\right)}\right)$
2. Using strategy rm
3. Applied associate-*r*13.7

$\leadsto \sin^{-1} \left(\sqrt{\left(\left(X \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(X \cdot \sin \left(\frac{a}{2}\right)\right) + \left(Y \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(Y \cdot \sin \left(\frac{a}{2}\right)\right)\right) + \color{blue}{\left(\left(Z \cdot \sin \left(\frac{a}{2}\right)\right) \cdot Z\right) \cdot \sin \left(\frac{a}{2}\right)}}\right)$
4. Final simplification13.7

$\leadsto \sin^{-1} \left(\sqrt{\left(\left(X \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(X \cdot \sin \left(\frac{a}{2}\right)\right) + \left(Y \cdot \sin \left(\frac{a}{2}\right)\right) \cdot \left(Y \cdot \sin \left(\frac{a}{2}\right)\right)\right) + \left(\left(Z \cdot \sin \left(\frac{a}{2}\right)\right) \cdot Z\right) \cdot \sin \left(\frac{a}{2}\right)}\right)$

# Reproduce

herbie shell --seed 1
(FPCore (X a Y Z)
:name "asin(sqrt((X * sin(a / 2))*(X * sin(a / 2)) + (Y * sin(a / 2))*(Y * sin(a / 2)) + (Z * sin(a / 2))*(Z * sin(a / 2))))"
:precision binary64
(asin (sqrt (+ (+ (* (* X (sin (/ a 2))) (* X (sin (/ a 2)))) (* (* Y (sin (/ a 2))) (* Y (sin (/ a 2))))) (* (* Z (sin (/ a 2))) (* Z (sin (/ a 2))))))))