Average Error: 1.4 → 1.2
Time: 4.6s
Precision: 64
\[\frac{1}{3} \cdot \cos^{-1} \left(\frac{3 \cdot \frac{x}{y \cdot 27}}{z \cdot 2} \cdot \sqrt{t}\right)\]
\[1 \cdot \frac{\cos^{-1} \left(\frac{3 \cdot x}{2} \cdot \frac{\sqrt{t}}{z \cdot \left(y \cdot 27\right)}\right)}{3}\]
\frac{1}{3} \cdot \cos^{-1} \left(\frac{3 \cdot \frac{x}{y \cdot 27}}{z \cdot 2} \cdot \sqrt{t}\right)
1 \cdot \frac{\cos^{-1} \left(\frac{3 \cdot x}{2} \cdot \frac{\sqrt{t}}{z \cdot \left(y \cdot 27\right)}\right)}{3}
double code(double x, double y, double z, double t) {
	return ((1.0 / 3.0) * acos((((3.0 * (x / (y * 27.0))) / (z * 2.0)) * sqrt(t))));
}
double code(double x, double y, double z, double t) {
	return (1.0 * (acos((((3.0 * x) / 2.0) * (sqrt(t) / (z * (y * 27.0))))) / 3.0));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.4
Target1.2
Herbie1.2
\[\frac{\cos^{-1} \left(\frac{\frac{x}{27}}{y \cdot z} \cdot \frac{\sqrt{t}}{\frac{2}{3}}\right)}{3}\]

Derivation

  1. Initial program 1.4

    \[\frac{1}{3} \cdot \cos^{-1} \left(\frac{3 \cdot \frac{x}{y \cdot 27}}{z \cdot 2} \cdot \sqrt{t}\right)\]
  2. Using strategy rm
  3. Applied *-commutative1.4

    \[\leadsto \frac{1}{3} \cdot \cos^{-1} \left(\frac{3 \cdot \frac{x}{y \cdot 27}}{\color{blue}{2 \cdot z}} \cdot \sqrt{t}\right)\]
  4. Applied div-inv1.4

    \[\leadsto \frac{1}{3} \cdot \cos^{-1} \left(\frac{3 \cdot \color{blue}{\left(x \cdot \frac{1}{y \cdot 27}\right)}}{2 \cdot z} \cdot \sqrt{t}\right)\]
  5. Applied associate-*r*1.4

    \[\leadsto \frac{1}{3} \cdot \cos^{-1} \left(\frac{\color{blue}{\left(3 \cdot x\right) \cdot \frac{1}{y \cdot 27}}}{2 \cdot z} \cdot \sqrt{t}\right)\]
  6. Applied times-frac1.3

    \[\leadsto \frac{1}{3} \cdot \cos^{-1} \left(\color{blue}{\left(\frac{3 \cdot x}{2} \cdot \frac{\frac{1}{y \cdot 27}}{z}\right)} \cdot \sqrt{t}\right)\]
  7. Applied associate-*l*1.3

    \[\leadsto \frac{1}{3} \cdot \cos^{-1} \color{blue}{\left(\frac{3 \cdot x}{2} \cdot \left(\frac{\frac{1}{y \cdot 27}}{z} \cdot \sqrt{t}\right)\right)}\]
  8. Simplified1.2

    \[\leadsto \frac{1}{3} \cdot \cos^{-1} \left(\frac{3 \cdot x}{2} \cdot \color{blue}{\frac{\sqrt{t}}{z \cdot \left(y \cdot 27\right)}}\right)\]
  9. Using strategy rm
  10. Applied div-inv1.2

    \[\leadsto \color{blue}{\left(1 \cdot \frac{1}{3}\right)} \cdot \cos^{-1} \left(\frac{3 \cdot x}{2} \cdot \frac{\sqrt{t}}{z \cdot \left(y \cdot 27\right)}\right)\]
  11. Applied associate-*l*1.2

    \[\leadsto \color{blue}{1 \cdot \left(\frac{1}{3} \cdot \cos^{-1} \left(\frac{3 \cdot x}{2} \cdot \frac{\sqrt{t}}{z \cdot \left(y \cdot 27\right)}\right)\right)}\]
  12. Simplified1.2

    \[\leadsto 1 \cdot \color{blue}{\frac{\cos^{-1} \left(\frac{3 \cdot x}{2} \cdot \frac{\sqrt{t}}{z \cdot \left(y \cdot 27\right)}\right)}{3}}\]
  13. Final simplification1.2

    \[\leadsto 1 \cdot \frac{\cos^{-1} \left(\frac{3 \cdot x}{2} \cdot \frac{\sqrt{t}}{z \cdot \left(y \cdot 27\right)}\right)}{3}\]

Reproduce

herbie shell --seed 2020071 +o rules:numerics
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, D"
  :precision binary64

  :herbie-target
  (/ (acos (* (/ (/ x 27) (* y z)) (/ (sqrt t) (/ 2 3)))) 3)

  (* (/ 1 3) (acos (* (/ (* 3 (/ x (* y 27))) (* z 2)) (sqrt t)))))