?

Average Error: 1.98% → 0.34%
Time: 15.1s
Precision: binary64
Cost: 39360

?

\[\frac{1}{3} \cdot \cos^{-1} \left(\frac{3 \cdot \frac{x}{y \cdot 27}}{z \cdot 2} \cdot \sqrt{t}\right) \]
\[e^{e^{\mathsf{log1p}\left(\mathsf{log1p}\left(0.3333333333333333 \cdot \cos^{-1} \left(\sqrt{t} \cdot \left(0.05555555555555555 \cdot \frac{x}{z \cdot y}\right)\right)\right)\right)} + -1} + -1 \]
(FPCore (x y z t)
 :precision binary64
 (* (/ 1.0 3.0) (acos (* (/ (* 3.0 (/ x (* y 27.0))) (* z 2.0)) (sqrt t)))))
(FPCore (x y z t)
 :precision binary64
 (+
  (exp
   (+
    (exp
     (log1p
      (log1p
       (*
        0.3333333333333333
        (acos (* (sqrt t) (* 0.05555555555555555 (/ x (* z y)))))))))
    -1.0))
  -1.0))
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 exp((exp(log1p(log1p((0.3333333333333333 * acos((sqrt(t) * (0.05555555555555555 * (x / (z * y))))))))) + -1.0)) + -1.0;
}
public static double code(double x, double y, double z, double t) {
	return (1.0 / 3.0) * Math.acos((((3.0 * (x / (y * 27.0))) / (z * 2.0)) * Math.sqrt(t)));
}
public static double code(double x, double y, double z, double t) {
	return Math.exp((Math.exp(Math.log1p(Math.log1p((0.3333333333333333 * Math.acos((Math.sqrt(t) * (0.05555555555555555 * (x / (z * y))))))))) + -1.0)) + -1.0;
}
def code(x, y, z, t):
	return (1.0 / 3.0) * math.acos((((3.0 * (x / (y * 27.0))) / (z * 2.0)) * math.sqrt(t)))
def code(x, y, z, t):
	return math.exp((math.exp(math.log1p(math.log1p((0.3333333333333333 * math.acos((math.sqrt(t) * (0.05555555555555555 * (x / (z * y))))))))) + -1.0)) + -1.0
function code(x, y, z, t)
	return Float64(Float64(1.0 / 3.0) * acos(Float64(Float64(Float64(3.0 * Float64(x / Float64(y * 27.0))) / Float64(z * 2.0)) * sqrt(t))))
end
function code(x, y, z, t)
	return Float64(exp(Float64(exp(log1p(log1p(Float64(0.3333333333333333 * acos(Float64(sqrt(t) * Float64(0.05555555555555555 * Float64(x / Float64(z * y))))))))) + -1.0)) + -1.0)
end
code[x_, y_, z_, t_] := N[(N[(1.0 / 3.0), $MachinePrecision] * N[ArcCos[N[(N[(N[(3.0 * N[(x / N[(y * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * 2.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[Exp[N[(N[Exp[N[Log[1 + N[Log[1 + N[(0.3333333333333333 * N[ArcCos[N[(N[Sqrt[t], $MachinePrecision] * N[(0.05555555555555555 * N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] + -1.0), $MachinePrecision]
\frac{1}{3} \cdot \cos^{-1} \left(\frac{3 \cdot \frac{x}{y \cdot 27}}{z \cdot 2} \cdot \sqrt{t}\right)
e^{e^{\mathsf{log1p}\left(\mathsf{log1p}\left(0.3333333333333333 \cdot \cos^{-1} \left(\sqrt{t} \cdot \left(0.05555555555555555 \cdot \frac{x}{z \cdot y}\right)\right)\right)\right)} + -1} + -1

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.98%
Target1.8%
Herbie0.34%
\[\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.98

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

    \[\leadsto \color{blue}{0.3333333333333333 \cdot \cos^{-1} \left(\left(\frac{x}{y \cdot z} \cdot 0.05555555555555555\right) \cdot \sqrt{t}\right)} \]
    Proof

    [Start]1.98

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

    metadata-eval [=>]1.98

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

    *-commutative [=>]1.98

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

    associate-*l/ [=>]2

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

    times-frac [=>]1.99

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

    times-frac [=>]1.99

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

    associate-/l/ [=>]1.81

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

    *-commutative [=>]1.81

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

    metadata-eval [=>]1.81

    \[ 0.3333333333333333 \cdot \cos^{-1} \left(\left(\frac{x}{y \cdot z} \cdot \frac{\color{blue}{0.1111111111111111}}{2}\right) \cdot \sqrt{t}\right) \]

    metadata-eval [=>]1.81

    \[ 0.3333333333333333 \cdot \cos^{-1} \left(\left(\frac{x}{y \cdot z} \cdot \color{blue}{0.05555555555555555}\right) \cdot \sqrt{t}\right) \]
  3. Applied egg-rr0.36

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(0.3333333333333333 \cdot \cos^{-1} \left(\frac{0.05555555555555555}{\frac{\frac{z}{x} \cdot y}{\sqrt{t}}}\right)\right)} - 1} \]
  4. Applied egg-rr0.34

    \[\leadsto e^{\color{blue}{e^{\mathsf{log1p}\left(\mathsf{log1p}\left(0.3333333333333333 \cdot \cos^{-1} \left(\sqrt{t} \cdot \left(0.05555555555555555 \cdot \frac{x}{z \cdot y}\right)\right)\right)\right)} - 1}} - 1 \]
  5. Final simplification0.34

    \[\leadsto e^{e^{\mathsf{log1p}\left(\mathsf{log1p}\left(0.3333333333333333 \cdot \cos^{-1} \left(\sqrt{t} \cdot \left(0.05555555555555555 \cdot \frac{x}{z \cdot y}\right)\right)\right)\right)} + -1} + -1 \]

Alternatives

Alternative 1
Error0.36%
Cost26432
\[e^{\mathsf{log1p}\left(0.3333333333333333 \cdot \cos^{-1} \left(\frac{0.05555555555555555}{\frac{y \cdot \frac{z}{x}}{\sqrt{t}}}\right)\right)} + -1 \]
Alternative 2
Error0.33%
Cost26432
\[e^{\mathsf{log1p}\left(0.3333333333333333 \cdot \cos^{-1} \left(\frac{0.05555555555555555}{\frac{\frac{z \cdot y}{x}}{\sqrt{t}}}\right)\right)} + -1 \]
Alternative 3
Error1.99%
Cost13504
\[0.3333333333333333 \cdot \cos^{-1} \left(\sqrt{t} \cdot \left(0.05555555555555555 \cdot \frac{\frac{x}{y}}{z}\right)\right) \]
Alternative 4
Error1.81%
Cost13504
\[0.3333333333333333 \cdot \cos^{-1} \left(\sqrt{t} \cdot \left(0.05555555555555555 \cdot \frac{x}{z \cdot y}\right)\right) \]
Alternative 5
Error3.06%
Cost6592
\[0.3333333333333333 \cdot \cos^{-1} 0 \]

Error

Reproduce?

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

  :herbie-target
  (/ (acos (* (/ (/ x 27.0) (* y z)) (/ (sqrt t) (/ 2.0 3.0)))) 3.0)

  (* (/ 1.0 3.0) (acos (* (/ (* 3.0 (/ x (* y 27.0))) (* z 2.0)) (sqrt t)))))