?

Average Error: 20.7 → 16.4
Time: 37.8s
Precision: binary64
Cost: 87304

?

\[ \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 := \frac{a}{b \cdot 3}\\ t_2 := t \cdot \left(z \cdot 0.3333333333333333\right)\\ t_3 := \sin t_2\\ t_4 := 2 \cdot \sqrt{x}\\ t_5 := \cos y \cdot \cos t_2\\ \mathbf{if}\;z \cdot t \leq -4 \cdot 10^{+34}:\\ \;\;\;\;t_4 - t_1\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+293}:\\ \;\;\;\;\frac{t_4}{\frac{t_5 - \sin y \cdot t_3}{t_5 \cdot t_5 - {\sin y}^{2} \cdot \left(t_3 \cdot t_3\right)}} - t_1\\ \mathbf{else}:\\ \;\;\;\;t_4 \cdot \mathsf{log1p}\left(\sqrt{{\left(\mathsf{expm1}\left(\cos y\right)\right)}^{2}}\right) - t_1\\ \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 (/ a (* b 3.0)))
        (t_2 (* t (* z 0.3333333333333333)))
        (t_3 (sin t_2))
        (t_4 (* 2.0 (sqrt x)))
        (t_5 (* (cos y) (cos t_2))))
   (if (<= (* z t) -4e+34)
     (- t_4 t_1)
     (if (<= (* z t) 5e+293)
       (-
        (/
         t_4
         (/
          (- t_5 (* (sin y) t_3))
          (- (* t_5 t_5) (* (pow (sin y) 2.0) (* t_3 t_3)))))
        t_1)
       (- (* t_4 (log1p (sqrt (pow (expm1 (cos y)) 2.0)))) t_1)))))
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 = a / (b * 3.0);
	double t_2 = t * (z * 0.3333333333333333);
	double t_3 = sin(t_2);
	double t_4 = 2.0 * sqrt(x);
	double t_5 = cos(y) * cos(t_2);
	double tmp;
	if ((z * t) <= -4e+34) {
		tmp = t_4 - t_1;
	} else if ((z * t) <= 5e+293) {
		tmp = (t_4 / ((t_5 - (sin(y) * t_3)) / ((t_5 * t_5) - (pow(sin(y), 2.0) * (t_3 * t_3))))) - t_1;
	} else {
		tmp = (t_4 * log1p(sqrt(pow(expm1(cos(y)), 2.0)))) - t_1;
	}
	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 = a / (b * 3.0);
	double t_2 = t * (z * 0.3333333333333333);
	double t_3 = Math.sin(t_2);
	double t_4 = 2.0 * Math.sqrt(x);
	double t_5 = Math.cos(y) * Math.cos(t_2);
	double tmp;
	if ((z * t) <= -4e+34) {
		tmp = t_4 - t_1;
	} else if ((z * t) <= 5e+293) {
		tmp = (t_4 / ((t_5 - (Math.sin(y) * t_3)) / ((t_5 * t_5) - (Math.pow(Math.sin(y), 2.0) * (t_3 * t_3))))) - t_1;
	} else {
		tmp = (t_4 * Math.log1p(Math.sqrt(Math.pow(Math.expm1(Math.cos(y)), 2.0)))) - t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	return ((2.0 * math.sqrt(x)) * math.cos((y - ((z * t) / 3.0)))) - (a / (b * 3.0))
def code(x, y, z, t, a, b):
	t_1 = a / (b * 3.0)
	t_2 = t * (z * 0.3333333333333333)
	t_3 = math.sin(t_2)
	t_4 = 2.0 * math.sqrt(x)
	t_5 = math.cos(y) * math.cos(t_2)
	tmp = 0
	if (z * t) <= -4e+34:
		tmp = t_4 - t_1
	elif (z * t) <= 5e+293:
		tmp = (t_4 / ((t_5 - (math.sin(y) * t_3)) / ((t_5 * t_5) - (math.pow(math.sin(y), 2.0) * (t_3 * t_3))))) - t_1
	else:
		tmp = (t_4 * math.log1p(math.sqrt(math.pow(math.expm1(math.cos(y)), 2.0)))) - t_1
	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(a / Float64(b * 3.0))
	t_2 = Float64(t * Float64(z * 0.3333333333333333))
	t_3 = sin(t_2)
	t_4 = Float64(2.0 * sqrt(x))
	t_5 = Float64(cos(y) * cos(t_2))
	tmp = 0.0
	if (Float64(z * t) <= -4e+34)
		tmp = Float64(t_4 - t_1);
	elseif (Float64(z * t) <= 5e+293)
		tmp = Float64(Float64(t_4 / Float64(Float64(t_5 - Float64(sin(y) * t_3)) / Float64(Float64(t_5 * t_5) - Float64((sin(y) ^ 2.0) * Float64(t_3 * t_3))))) - t_1);
	else
		tmp = Float64(Float64(t_4 * log1p(sqrt((expm1(cos(y)) ^ 2.0)))) - t_1);
	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[(a / N[(b * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[Cos[y], $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -4e+34], N[(t$95$4 - t$95$1), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+293], N[(N[(t$95$4 / N[(N[(t$95$5 - N[(N[Sin[y], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$5 * t$95$5), $MachinePrecision] - N[(N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$3 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(t$95$4 * N[Log[1 + N[Sqrt[N[Power[N[(Exp[N[Cos[y], $MachinePrecision]] - 1), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $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 := \frac{a}{b \cdot 3}\\
t_2 := t \cdot \left(z \cdot 0.3333333333333333\right)\\
t_3 := \sin t_2\\
t_4 := 2 \cdot \sqrt{x}\\
t_5 := \cos y \cdot \cos t_2\\
\mathbf{if}\;z \cdot t \leq -4 \cdot 10^{+34}:\\
\;\;\;\;t_4 - t_1\\

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+293}:\\
\;\;\;\;\frac{t_4}{\frac{t_5 - \sin y \cdot t_3}{t_5 \cdot t_5 - {\sin y}^{2} \cdot \left(t_3 \cdot t_3\right)}} - t_1\\

\mathbf{else}:\\
\;\;\;\;t_4 \cdot \mathsf{log1p}\left(\sqrt{{\left(\mathsf{expm1}\left(\cos y\right)\right)}^{2}}\right) - t_1\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original20.7
Target18.8
Herbie16.4
\[\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) < -3.99999999999999978e34

    1. Initial program 42.2

      \[\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.9

      \[\leadsto \left(2 \cdot \sqrt{x}\right) \cdot \color{blue}{\cos y} - \frac{a}{b \cdot 3} \]
    3. Taylor expanded in y around 0 32.9

      \[\leadsto \color{blue}{2 \cdot \sqrt{x}} - \frac{a}{b \cdot 3} \]

    if -3.99999999999999978e34 < (*.f64 z t) < 5.00000000000000033e293

    1. Initial program 10.1

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

      \[\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]10.1

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

      associate-*l* [=>]10.1

      \[ \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* [<=]10.1

      \[ \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 [<=]10.1

      \[ \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 [=>]10.1

      \[ \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 [<=]10.1

      \[ \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 [=>]10.1

      \[ \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/ [<=]10.1

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

      *-commutative [=>]10.1

      \[ \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-rr25.2

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

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\cos \left(y - \left(z \cdot 0.3333333333333333\right) \cdot t\right) \cdot \left(2 \cdot \sqrt{x}\right)\right)} - 1\right)} - \frac{a}{3 \cdot b} \]
    5. Applied egg-rr9.6

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

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

      [Start]9.6

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

      associate-/l* [=>]9.6

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

      associate-*r* [=>]9.6

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

      associate-*r* [=>]9.6

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

    if 5.00000000000000033e293 < (*.f64 z t)

    1. Initial program 61.3

      \[\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.4

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -4 \cdot 10^{+34}:\\ \;\;\;\;2 \cdot \sqrt{x} - \frac{a}{b \cdot 3}\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+293}:\\ \;\;\;\;\frac{2 \cdot \sqrt{x}}{\frac{\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)}{\left(\cos y \cdot \cos \left(t \cdot \left(z \cdot 0.3333333333333333\right)\right)\right) \cdot \left(\cos y \cdot \cos \left(t \cdot \left(z \cdot 0.3333333333333333\right)\right)\right) - {\sin y}^{2} \cdot \left(\sin \left(t \cdot \left(z \cdot 0.3333333333333333\right)\right) \cdot \sin \left(t \cdot \left(z \cdot 0.3333333333333333\right)\right)\right)}} - \frac{a}{b \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \mathsf{log1p}\left(\sqrt{{\left(\mathsf{expm1}\left(\cos y\right)\right)}^{2}}\right) - \frac{a}{b \cdot 3}\\ \end{array} \]

Alternatives

Alternative 1
Error16.4
Cost40648
\[\begin{array}{l} t_1 := 2 \cdot \sqrt{x}\\ t_2 := \frac{a}{b \cdot 3}\\ t_3 := t \cdot \left(z \cdot 0.3333333333333333\right)\\ \mathbf{if}\;z \cdot t \leq -4 \cdot 10^{+34}:\\ \;\;\;\;t_1 - t_2\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+293}:\\ \;\;\;\;2 \cdot \left(\sqrt{x} \cdot \left(\sin y \cdot \sin t_3\right) + \sqrt{x} \cdot \left(\cos y \cdot \cos t_3\right)\right) - t_2\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \mathsf{log1p}\left(\sqrt{{\left(\mathsf{expm1}\left(\cos y\right)\right)}^{2}}\right) - t_2\\ \end{array} \]
Alternative 2
Error16.3
Cost40392
\[\begin{array}{l} t_1 := \frac{a}{b \cdot 3}\\ t_2 := 2 \cdot \sqrt{x}\\ \mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+41}:\\ \;\;\;\;t_2 - t_1\\ \mathbf{elif}\;z \cdot t \leq 10^{+22}:\\ \;\;\;\;2 \cdot \left(\sqrt{x} \cdot \mathsf{fma}\left(\cos \left(t \cdot \frac{z}{-3}\right), \cos y, \sin y \cdot \sin \left(\left(z \cdot t\right) \cdot 0.3333333333333333\right)\right)\right) - t_1\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \mathsf{expm1}\left(\mathsf{fma}\left(-0.25, y \cdot y, \log 2\right)\right) - t_1\\ \end{array} \]
Alternative 3
Error16.3
Cost34120
\[\begin{array}{l} t_1 := 2 \cdot \sqrt{x}\\ t_2 := \frac{a}{b \cdot 3}\\ t_3 := t \cdot \frac{z}{-3}\\ \mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+41}:\\ \;\;\;\;t_1 - t_2\\ \mathbf{elif}\;z \cdot t \leq 10^{+22}:\\ \;\;\;\;2 \cdot \left(\sqrt{x} \cdot \left(\cos y \cdot \cos t_3 - \sin y \cdot \sin t_3\right)\right) - t_2\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \mathsf{expm1}\left(\mathsf{fma}\left(-0.25, y \cdot y, \log 2\right)\right) - t_2\\ \end{array} \]
Alternative 4
Error16.3
Cost34120
\[\begin{array}{l} t_1 := \frac{a}{b \cdot 3}\\ t_2 := 2 \cdot \sqrt{x}\\ \mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+41}:\\ \;\;\;\;t_2 - t_1\\ \mathbf{elif}\;z \cdot t \leq 10^{+22}:\\ \;\;\;\;t_2 \cdot \left(\cos y \cdot \cos \left(t \cdot \frac{z}{3}\right) - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - t_1\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \mathsf{expm1}\left(\mathsf{fma}\left(-0.25, y \cdot y, \log 2\right)\right) - t_1\\ \end{array} \]
Alternative 5
Error17.1
Cost19776
\[\mathsf{fma}\left(2, \sqrt{x} \cdot \cos y, \frac{\frac{a}{-3}}{b}\right) \]
Alternative 6
Error20.2
Cost14025
\[\begin{array}{l} t_1 := \frac{a}{b \cdot 3}\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{-63} \lor \neg \left(t_1 \leq 10^{-73}\right):\\ \;\;\;\;\mathsf{fma}\left(2, \sqrt{x}, \frac{\frac{a}{-3}}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot \left(2 \cdot \cos y\right)\\ \end{array} \]
Alternative 7
Error20.2
Cost13897
\[\begin{array}{l} t_1 := \frac{a}{b \cdot 3}\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{-63} \lor \neg \left(t_1 \leq 10^{-73}\right):\\ \;\;\;\;2 \cdot \sqrt{x} - t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot \left(2 \cdot \cos y\right)\\ \end{array} \]
Alternative 8
Error17.1
Cost13504
\[\frac{-0.3333333333333333}{\frac{b}{a}} + 2 \cdot \left(\sqrt{x} \cdot \cos y\right) \]
Alternative 9
Error17.1
Cost13504
\[\left(2 \cdot \sqrt{x}\right) \cdot \cos y + a \cdot \frac{-0.3333333333333333}{b} \]
Alternative 10
Error17.1
Cost13504
\[\left(2 \cdot \sqrt{x}\right) \cdot \cos y - \frac{a}{b \cdot 3} \]
Alternative 11
Error25.2
Cost6976
\[2 \cdot \sqrt{x} + -0.3333333333333333 \cdot \frac{a}{b} \]
Alternative 12
Error25.1
Cost6976
\[2 \cdot \sqrt{x} - \frac{a}{b \cdot 3} \]
Alternative 13
Error35.7
Cost320
\[-0.3333333333333333 \cdot \frac{a}{b} \]
Alternative 14
Error35.7
Cost320
\[\frac{a \cdot -0.3333333333333333}{b} \]
Alternative 15
Error35.6
Cost320
\[\frac{\frac{a}{-3}}{b} \]

Error

Reproduce?

herbie shell --seed 2023073 
(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))))