Average Error: 20.6 → 16.6
Time: 40.1s
Precision: binary64
Cost: 65800
\[ \begin{array}{c}[z, t] = \mathsf{sort}([z, t])\\ \end{array} \]
\[\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right) - \frac{a}{b \cdot 3} \]
\[\begin{array}{l} t_1 := {\cos y}^{2} \cdot \left(x \cdot 4\right)\\ t_2 := \frac{a}{b \cdot 3}\\ \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+21}:\\ \;\;\;\;\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(t_1\right)\right)} - t_2\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+256}:\\ \;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(t \cdot \frac{z}{3}\right) - \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right) \cdot \sin y\right) - t_2\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt[3]{\sqrt[3]{t_1}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt[3]{\cos y \cdot \sqrt{x \cdot 4}}}\right)}^{3} - t_2\\ \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (- (* (* 2.0 (sqrt x)) (cos (- y (/ (* z t) 3.0)))) (/ a (* b 3.0))))
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (pow (cos y) 2.0) (* x 4.0))) (t_2 (/ a (* b 3.0))))
   (if (<= (* z t) -1e+21)
     (- (sqrt (expm1 (log1p t_1))) t_2)
     (if (<= (* z t) 5e+256)
       (-
        (*
         (* 2.0 (sqrt x))
         (-
          (* (cos y) (cos (* t (/ z 3.0))))
          (* (sin (* t (* z -0.3333333333333333))) (sin y))))
        t_2)
       (-
        (*
         (pow (cbrt (cbrt t_1)) 3.0)
         (pow (cbrt (cbrt (* (cos y) (sqrt (* x 4.0))))) 3.0))
        t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
	return ((2.0 * sqrt(x)) * cos((y - ((z * t) / 3.0)))) - (a / (b * 3.0));
}
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = pow(cos(y), 2.0) * (x * 4.0);
	double t_2 = a / (b * 3.0);
	double tmp;
	if ((z * t) <= -1e+21) {
		tmp = sqrt(expm1(log1p(t_1))) - t_2;
	} else if ((z * t) <= 5e+256) {
		tmp = ((2.0 * sqrt(x)) * ((cos(y) * cos((t * (z / 3.0)))) - (sin((t * (z * -0.3333333333333333))) * sin(y)))) - t_2;
	} else {
		tmp = (pow(cbrt(cbrt(t_1)), 3.0) * pow(cbrt(cbrt((cos(y) * sqrt((x * 4.0))))), 3.0)) - t_2;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((2.0 * Math.sqrt(x)) * Math.cos((y - ((z * t) / 3.0)))) - (a / (b * 3.0));
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = Math.pow(Math.cos(y), 2.0) * (x * 4.0);
	double t_2 = a / (b * 3.0);
	double tmp;
	if ((z * t) <= -1e+21) {
		tmp = Math.sqrt(Math.expm1(Math.log1p(t_1))) - t_2;
	} else if ((z * t) <= 5e+256) {
		tmp = ((2.0 * Math.sqrt(x)) * ((Math.cos(y) * Math.cos((t * (z / 3.0)))) - (Math.sin((t * (z * -0.3333333333333333))) * Math.sin(y)))) - t_2;
	} else {
		tmp = (Math.pow(Math.cbrt(Math.cbrt(t_1)), 3.0) * Math.pow(Math.cbrt(Math.cbrt((Math.cos(y) * Math.sqrt((x * 4.0))))), 3.0)) - t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(2.0 * sqrt(x)) * cos(Float64(y - Float64(Float64(z * t) / 3.0)))) - Float64(a / Float64(b * 3.0)))
end
function code(x, y, z, t, a, b)
	t_1 = Float64((cos(y) ^ 2.0) * Float64(x * 4.0))
	t_2 = Float64(a / Float64(b * 3.0))
	tmp = 0.0
	if (Float64(z * t) <= -1e+21)
		tmp = Float64(sqrt(expm1(log1p(t_1))) - t_2);
	elseif (Float64(z * t) <= 5e+256)
		tmp = Float64(Float64(Float64(2.0 * sqrt(x)) * Float64(Float64(cos(y) * cos(Float64(t * Float64(z / 3.0)))) - Float64(sin(Float64(t * Float64(z * -0.3333333333333333))) * sin(y)))) - t_2);
	else
		tmp = Float64(Float64((cbrt(cbrt(t_1)) ^ 3.0) * (cbrt(cbrt(Float64(cos(y) * sqrt(Float64(x * 4.0))))) ^ 3.0)) - t_2);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(2.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(y - N[(N[(z * t), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(a / N[(b * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Power[N[Cos[y], $MachinePrecision], 2.0], $MachinePrecision] * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a / N[(b * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e+21], N[(N[Sqrt[N[(Exp[N[Log[1 + t$95$1], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+256], N[(N[(N[(2.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[y], $MachinePrecision] * N[Cos[N[(t * N[(z / 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[N[(t * N[(z * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(N[Power[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] * N[Power[N[Power[N[Power[N[(N[Cos[y], $MachinePrecision] * N[Sqrt[N[(x * 4.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right) - \frac{a}{b \cdot 3}
\begin{array}{l}
t_1 := {\cos y}^{2} \cdot \left(x \cdot 4\right)\\
t_2 := \frac{a}{b \cdot 3}\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+21}:\\
\;\;\;\;\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(t_1\right)\right)} - t_2\\

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+256}:\\
\;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(t \cdot \frac{z}{3}\right) - \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right) \cdot \sin y\right) - t_2\\

\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{\sqrt[3]{t_1}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt[3]{\cos y \cdot \sqrt{x \cdot 4}}}\right)}^{3} - t_2\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original20.6
Target19.0
Herbie16.6
\[\begin{array}{l} \mathbf{if}\;z < -1.3793337487235141 \cdot 10^{+129}:\\ \;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(\frac{1}{y} - \frac{\frac{0.3333333333333333}{z}}{t}\right) - \frac{\frac{a}{3}}{b}\\ \mathbf{elif}\;z < 3.516290613555987 \cdot 10^{+106}:\\ \;\;\;\;\left(\sqrt{x} \cdot 2\right) \cdot \cos \left(y - \frac{t}{3} \cdot z\right) - \frac{\frac{a}{3}}{b}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(y - \frac{\frac{0.3333333333333333}{z}}{t}\right) \cdot \left(2 \cdot \sqrt{x}\right) - \frac{\frac{a}{b}}{3}\\ \end{array} \]

Derivation

  1. Split input into 3 regimes
  2. if (*.f64 z t) < -1e21

    1. Initial program 40.4

      \[\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right) - \frac{a}{b \cdot 3} \]
    2. Taylor expanded in z around 0 32.6

      \[\leadsto \left(2 \cdot \sqrt{x}\right) \cdot \color{blue}{\cos y} - \frac{a}{b \cdot 3} \]
    3. Applied egg-rr32.7

      \[\leadsto \color{blue}{\sqrt{{\cos y}^{2} \cdot \left(x \cdot 4\right)}} - \frac{a}{b \cdot 3} \]
    4. Applied egg-rr32.7

      \[\leadsto \sqrt{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\cos y}^{2} \cdot \left(x \cdot 4\right)\right)\right)}} - \frac{a}{b \cdot 3} \]

    if -1e21 < (*.f64 z t) < 5.00000000000000015e256

    1. Initial program 9.2

      \[\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right) - \frac{a}{b \cdot 3} \]
    2. Simplified9.2

      \[\leadsto \color{blue}{\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z}{3} \cdot t\right) - \frac{a}{3 \cdot b}} \]
      Proof

      [Start]9.2

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

      associate-*l* [=>]9.2

      \[ \color{blue}{2 \cdot \left(\sqrt{x} \cdot \cos \left(y - \frac{z \cdot t}{3}\right)\right)} - \frac{a}{b \cdot 3} \]

      associate-*l* [<=]9.2

      \[ \color{blue}{\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right)} - \frac{a}{b \cdot 3} \]

      remove-double-neg [<=]9.2

      \[ \color{blue}{\left(-\left(-\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right)\right)\right)} - \frac{a}{b \cdot 3} \]

      neg-mul-1 [=>]9.2

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

      neg-mul-1 [<=]9.2

      \[ \color{blue}{\left(-\left(-\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right)\right)\right)} - \frac{a}{b \cdot 3} \]

      remove-double-neg [=>]9.2

      \[ \color{blue}{\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right)} - \frac{a}{b \cdot 3} \]

      associate-*l/ [<=]9.2

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \color{blue}{\frac{z}{3} \cdot t}\right) - \frac{a}{b \cdot 3} \]

      *-commutative [=>]9.2

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z}{3} \cdot t\right) - \frac{a}{\color{blue}{3 \cdot b}} \]
    3. Applied egg-rr8.6

      \[\leadsto \left(2 \cdot \sqrt{x}\right) \cdot \color{blue}{\left(\cos y \cdot \cos \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right) - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right)} - \frac{a}{3 \cdot b} \]
    4. Simplified8.5

      \[\leadsto \left(2 \cdot \sqrt{x}\right) \cdot \color{blue}{\left(\cos y \cdot \cos \left(t \cdot \frac{z}{3}\right) - \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right) \cdot \sin y\right)} - \frac{a}{3 \cdot b} \]
      Proof

      [Start]8.6

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right) - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - \frac{a}{3 \cdot b} \]

      associate-*r* [=>]8.5

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot -0.3333333333333333\right)} - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - \frac{a}{3 \cdot b} \]

      *-commutative [<=]8.5

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot -0.3333333333333333\right) - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - \frac{a}{3 \cdot b} \]

      *-commutative [<=]8.5

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \color{blue}{\left(-0.3333333333333333 \cdot \left(z \cdot t\right)\right)} - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - \frac{a}{3 \cdot b} \]

      metadata-eval [<=]8.5

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(\color{blue}{\left(-0.3333333333333333\right)} \cdot \left(z \cdot t\right)\right) - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - \frac{a}{3 \cdot b} \]

      distribute-lft-neg-in [<=]8.5

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \color{blue}{\left(-0.3333333333333333 \cdot \left(z \cdot t\right)\right)} - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - \frac{a}{3 \cdot b} \]

      *-commutative [=>]8.5

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(-0.3333333333333333 \cdot \color{blue}{\left(t \cdot z\right)}\right) - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - \frac{a}{3 \cdot b} \]

      cos-neg [=>]8.5

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \color{blue}{\cos \left(0.3333333333333333 \cdot \left(t \cdot z\right)\right)} - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - \frac{a}{3 \cdot b} \]

      metadata-eval [<=]8.5

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

      *-commutative [<=]8.5

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

      associate-/r/ [<=]8.6

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

      associate-/l* [<=]8.5

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

      *-commutative [<=]8.5

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

      *-rgt-identity [=>]8.5

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(\frac{\color{blue}{z \cdot t}}{3}\right) - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - \frac{a}{3 \cdot b} \]

      *-commutative [=>]8.5

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(\frac{\color{blue}{t \cdot z}}{3}\right) - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - \frac{a}{3 \cdot b} \]

      associate-*r/ [<=]8.5

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \color{blue}{\left(t \cdot \frac{z}{3}\right)} - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - \frac{a}{3 \cdot b} \]

      *-commutative [=>]8.5

      \[ \left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(t \cdot \frac{z}{3}\right) - \color{blue}{\sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right) \cdot \sin y}\right) - \frac{a}{3 \cdot b} \]

    if 5.00000000000000015e256 < (*.f64 z t)

    1. Initial program 56.9

      \[\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right) - \frac{a}{b \cdot 3} \]
    2. Taylor expanded in z around 0 36.9

      \[\leadsto \left(2 \cdot \sqrt{x}\right) \cdot \color{blue}{\cos y} - \frac{a}{b \cdot 3} \]
    3. Applied egg-rr36.7

      \[\leadsto \color{blue}{\sqrt{{\cos y}^{2} \cdot \left(x \cdot 4\right)}} - \frac{a}{b \cdot 3} \]
    4. Applied egg-rr36.9

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\sqrt[3]{{\cos y}^{2} \cdot \left(x \cdot 4\right)}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt[3]{\cos y \cdot \sqrt{x \cdot 4}}}\right)}^{3}} - \frac{a}{b \cdot 3} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification16.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+21}:\\ \;\;\;\;\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left({\cos y}^{2} \cdot \left(x \cdot 4\right)\right)\right)} - \frac{a}{b \cdot 3}\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+256}:\\ \;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(t \cdot \frac{z}{3}\right) - \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right) \cdot \sin y\right) - \frac{a}{b \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt[3]{\sqrt[3]{{\cos y}^{2} \cdot \left(x \cdot 4\right)}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt[3]{\cos y \cdot \sqrt{x \cdot 4}}}\right)}^{3} - \frac{a}{b \cdot 3}\\ \end{array} \]

Alternatives

Alternative 1
Error16.6
Cost39944
\[\begin{array}{l} t_1 := {\cos y}^{2}\\ t_2 := \frac{a}{b \cdot 3}\\ \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+21}:\\ \;\;\;\;\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(t_1 \cdot \left(x \cdot 4\right)\right)\right)} - t_2\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+256}:\\ \;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(t \cdot \frac{z}{3}\right) - \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right) \cdot \sin y\right) - t_2\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \sqrt[3]{t_1 \cdot x}\right) \cdot \sqrt[3]{\cos y \cdot \sqrt{x}} - t_2\\ \end{array} \]
Alternative 2
Error16.6
Cost34120
\[\begin{array}{l} t_1 := t \cdot \frac{z}{-3}\\ t_2 := \frac{a}{b \cdot 3}\\ \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+21}:\\ \;\;\;\;\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left({\cos y}^{2} \cdot \left(x \cdot 4\right)\right)\right)} - t_2\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+256}:\\ \;\;\;\;2 \cdot \left(\sqrt{x} \cdot \left(\cos y \cdot \cos t_1 - \sin y \cdot \sin t_1\right)\right) - t_2\\ \mathbf{else}:\\ \;\;\;\;\cos y \cdot \left(2 \cdot \sqrt{x}\right) - t_2\\ \end{array} \]
Alternative 3
Error16.6
Cost34120
\[\begin{array}{l} t_1 := 2 \cdot \sqrt{x}\\ t_2 := \frac{a}{b \cdot 3}\\ \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+21}:\\ \;\;\;\;\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left({\cos y}^{2} \cdot \left(x \cdot 4\right)\right)\right)} - t_2\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+256}:\\ \;\;\;\;t_1 \cdot \left(\cos y \cdot \cos \left(t \cdot \frac{z}{3}\right) - \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right) \cdot \sin y\right) - t_2\\ \mathbf{else}:\\ \;\;\;\;\cos y \cdot t_1 - t_2\\ \end{array} \]
Alternative 4
Error17.0
Cost33028
\[\begin{array}{l} t_1 := 2 \cdot \sqrt{x}\\ t_2 := \frac{a}{b \cdot 3}\\ \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+99}:\\ \;\;\;\;\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left({\cos y}^{2} \cdot \left(x \cdot 4\right)\right)\right)} - t_2\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+256}:\\ \;\;\;\;t_1 \cdot \cos \left(y + z \cdot \frac{-1}{\frac{3}{t}}\right) - t_2\\ \mathbf{else}:\\ \;\;\;\;\cos y \cdot t_1 - t_2\\ \end{array} \]
Alternative 5
Error17.0
Cost26884
\[\begin{array}{l} t_1 := 2 \cdot \sqrt{x}\\ t_2 := \frac{a}{b \cdot 3}\\ \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+99}:\\ \;\;\;\;\left|\cos y \cdot \sqrt[3]{x \cdot 4}\right| \cdot {\left(x \cdot 4\right)}^{0.16666666666666666} - t_2\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+256}:\\ \;\;\;\;t_1 \cdot \cos \left(y + z \cdot \frac{-1}{\frac{3}{t}}\right) - t_2\\ \mathbf{else}:\\ \;\;\;\;\cos y \cdot t_1 - t_2\\ \end{array} \]
Alternative 6
Error17.1
Cost14536
\[\begin{array}{l} t_1 := 2 \cdot \sqrt{x}\\ t_2 := \frac{a}{b \cdot 3}\\ \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+99}:\\ \;\;\;\;\sqrt{x \cdot \left(2 + 2 \cdot \cos \left(y + y\right)\right)} - t_2\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+256}:\\ \;\;\;\;t_1 \cdot \cos \left(y + z \cdot \frac{-1}{\frac{3}{t}}\right) - t_2\\ \mathbf{else}:\\ \;\;\;\;\cos y \cdot t_1 - t_2\\ \end{array} \]
Alternative 7
Error17.1
Cost14408
\[\begin{array}{l} t_1 := 2 \cdot \sqrt{x}\\ t_2 := \frac{a}{b \cdot 3}\\ \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+99}:\\ \;\;\;\;\sqrt{x \cdot \left(2 + 2 \cdot \cos \left(y + y\right)\right)} - t_2\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+256}:\\ \;\;\;\;t_1 \cdot \cos \left(y + t \cdot \left(z \cdot -0.3333333333333333\right)\right) - t_2\\ \mathbf{else}:\\ \;\;\;\;\cos y \cdot t_1 - t_2\\ \end{array} \]
Alternative 8
Error21.2
Cost13897
\[\begin{array}{l} t_1 := \frac{a}{b \cdot 3}\\ \mathbf{if}\;t_1 \leq -2 \cdot 10^{-33} \lor \neg \left(t_1 \leq 2 \cdot 10^{-170}\right):\\ \;\;\;\;2 \cdot \sqrt{x} - t_1\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\cos y \cdot \sqrt{x}\right)\\ \end{array} \]
Alternative 9
Error17.5
Cost13504
\[\frac{-0.3333333333333333}{\frac{b}{a}} + 2 \cdot \left(\cos y \cdot \sqrt{x}\right) \]
Alternative 10
Error17.5
Cost13504
\[\cos y \cdot \left(2 \cdot \sqrt{x}\right) + a \cdot \frac{-0.3333333333333333}{b} \]
Alternative 11
Error17.4
Cost13504
\[\cos y \cdot \left(2 \cdot \sqrt{x}\right) - \frac{a}{b \cdot 3} \]
Alternative 12
Error25.4
Cost6976
\[2 \cdot \sqrt{x} - \frac{a}{b \cdot 3} \]
Alternative 13
Error36.2
Cost320
\[-0.3333333333333333 \cdot \frac{a}{b} \]
Alternative 14
Error36.2
Cost320
\[a \cdot \frac{-0.3333333333333333}{b} \]
Alternative 15
Error36.2
Cost320
\[\frac{a}{\frac{b}{-0.3333333333333333}} \]
Alternative 16
Error36.2
Cost320
\[\frac{\frac{a}{-3}}{b} \]

Error

Reproduce

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

  :herbie-target
  (if (< z -1.3793337487235141e+129) (- (* (* 2.0 (sqrt x)) (cos (- (/ 1.0 y) (/ (/ 0.3333333333333333 z) t)))) (/ (/ a 3.0) b)) (if (< z 3.516290613555987e+106) (- (* (* (sqrt x) 2.0) (cos (- y (* (/ t 3.0) z)))) (/ (/ a 3.0) b)) (- (* (cos (- y (/ (/ 0.3333333333333333 z) t))) (* 2.0 (sqrt x))) (/ (/ a b) 3.0))))

  (- (* (* 2.0 (sqrt x)) (cos (- y (/ (* z t) 3.0)))) (/ a (* b 3.0))))