?

Average Accuracy: 60.7% → 89.9%
Time: 32.2s
Precision: binary64
Cost: 7496

?

\[ \begin{array}{c}[x, y] = \mathsf{sort}([x, y])\\ \end{array} \]
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
\[\begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+139}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(\frac{a}{z} \cdot t\right) - z}\right)\\ \mathbf{elif}\;z \leq 10^{+99}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -5e+139)
   (* x (* y (/ z (- (* 0.5 (* (/ a z) t)) z))))
   (if (<= z 1e+99)
     (* x (* y (/ z (sqrt (- (* z z) (* a t))))))
     (* x (* y (/ z (+ z (* -0.5 (/ a (/ z t))))))))))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5e+139) {
		tmp = x * (y * (z / ((0.5 * ((a / z) * t)) - z)));
	} else if (z <= 1e+99) {
		tmp = x * (y * (z / sqrt(((z * z) - (a * t)))));
	} else {
		tmp = x * (y * (z / (z + (-0.5 * (a / (z / t))))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-5d+139)) then
        tmp = x * (y * (z / ((0.5d0 * ((a / z) * t)) - z)))
    else if (z <= 1d+99) then
        tmp = x * (y * (z / sqrt(((z * z) - (a * t)))))
    else
        tmp = x * (y * (z / (z + ((-0.5d0) * (a / (z / t))))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5e+139) {
		tmp = x * (y * (z / ((0.5 * ((a / z) * t)) - z)));
	} else if (z <= 1e+99) {
		tmp = x * (y * (z / Math.sqrt(((z * z) - (a * t)))));
	} else {
		tmp = x * (y * (z / (z + (-0.5 * (a / (z / t))))));
	}
	return tmp;
}
def code(x, y, z, t, a):
	return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
def code(x, y, z, t, a):
	tmp = 0
	if z <= -5e+139:
		tmp = x * (y * (z / ((0.5 * ((a / z) * t)) - z)))
	elif z <= 1e+99:
		tmp = x * (y * (z / math.sqrt(((z * z) - (a * t)))))
	else:
		tmp = x * (y * (z / (z + (-0.5 * (a / (z / t))))))
	return tmp
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a))))
end
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -5e+139)
		tmp = Float64(x * Float64(y * Float64(z / Float64(Float64(0.5 * Float64(Float64(a / z) * t)) - z))));
	elseif (z <= 1e+99)
		tmp = Float64(x * Float64(y * Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t))))));
	else
		tmp = Float64(x * Float64(y * Float64(z / Float64(z + Float64(-0.5 * Float64(a / Float64(z / t)))))));
	end
	return tmp
end
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) * z) / sqrt(((z * z) - (t * a)));
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -5e+139)
		tmp = x * (y * (z / ((0.5 * ((a / z) * t)) - z)));
	elseif (z <= 1e+99)
		tmp = x * (y * (z / sqrt(((z * z) - (a * t)))));
	else
		tmp = x * (y * (z / (z + (-0.5 * (a / (z / t))))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e+139], N[(x * N[(y * N[(z / N[(N[(0.5 * N[(N[(a / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+99], N[(x * N[(y * N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(z / N[(z + N[(-0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+139}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(\frac{a}{z} \cdot t\right) - z}\right)\\

\mathbf{elif}\;z \leq 10^{+99}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}\right)\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original60.7%
Target87.7%
Herbie89.9%
\[\begin{array}{l} \mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\ \;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Derivation?

  1. Split input into 3 regimes
  2. if z < -5.0000000000000003e139

    1. Initial program 20.0%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Simplified21.9%

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

      [Start]20.0

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

      associate-*r/ [<=]21.9

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

      associate-*l* [=>]21.9

      \[ \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
    3. Taylor expanded in z around -inf 91.1%

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\color{blue}{0.5 \cdot \frac{a \cdot t}{z} + -1 \cdot z}}\right) \]
    4. Applied egg-rr97.8%

      \[\leadsto x \cdot \left(y \cdot \frac{z}{0.5 \cdot \color{blue}{\left(\frac{a}{z} \cdot t\right)} + -1 \cdot z}\right) \]
      Proof

      [Start]91.1

      \[ x \cdot \left(y \cdot \frac{z}{0.5 \cdot \frac{a \cdot t}{z} + -1 \cdot z}\right) \]

      associate-/l* [=>]97.8

      \[ x \cdot \left(y \cdot \frac{z}{0.5 \cdot \color{blue}{\frac{a}{\frac{z}{t}}} + -1 \cdot z}\right) \]

      associate-/r/ [=>]97.8

      \[ x \cdot \left(y \cdot \frac{z}{0.5 \cdot \color{blue}{\left(\frac{a}{z} \cdot t\right)} + -1 \cdot z}\right) \]

    if -5.0000000000000003e139 < z < 9.9999999999999997e98

    1. Initial program 81.7%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Simplified85.0%

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

      [Start]81.7

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

      associate-*r/ [<=]84.5

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

      associate-*l* [=>]85.0

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

    if 9.9999999999999997e98 < z

    1. Initial program 33.7%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Simplified36.6%

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

      [Start]33.7

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

      associate-*r/ [<=]36.6

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

      associate-*l* [=>]36.6

      \[ \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
    3. Taylor expanded in z around inf 92.3%

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\color{blue}{z + -0.5 \cdot \frac{a \cdot t}{z}}}\right) \]
    4. Simplified97.6%

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\color{blue}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}}\right) \]
      Proof

      [Start]92.3

      \[ x \cdot \left(y \cdot \frac{z}{z + -0.5 \cdot \frac{a \cdot t}{z}}\right) \]

      associate-/l* [=>]97.6

      \[ x \cdot \left(y \cdot \frac{z}{z + -0.5 \cdot \color{blue}{\frac{a}{\frac{z}{t}}}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+139}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(\frac{a}{z} \cdot t\right) - z}\right)\\ \mathbf{elif}\;z \leq 10^{+99}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy81.1%
Cost7304
\[\begin{array}{l} t_1 := \frac{a}{\frac{z}{t}}\\ \mathbf{if}\;z \leq -5.4 \cdot 10^{-227}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot t_1 - z}\right)\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-132}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{a \cdot \left(-t\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{z + -0.5 \cdot t_1}\right)\\ \end{array} \]
Alternative 2
Accuracy81.6%
Cost7304
\[\begin{array}{l} t_1 := \frac{a}{\frac{z}{t}}\\ \mathbf{if}\;z \leq -5.7 \cdot 10^{-227}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot t_1 - z}\right)\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-132}:\\ \;\;\;\;\frac{x}{\frac{\sqrt{a \cdot \left(-t\right)}}{z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{z + -0.5 \cdot t_1}\right)\\ \end{array} \]
Alternative 3
Accuracy76.7%
Cost1224
\[\begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+108}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-228}:\\ \;\;\;\;x \cdot \left(z \cdot \frac{y}{0.5 \cdot \frac{a \cdot t}{z} - z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}\right)\\ \end{array} \]
Alternative 4
Accuracy72.4%
Cost1096
\[\begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{-69}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-98}:\\ \;\;\;\;-2 \cdot \left(\frac{y}{a} \cdot \frac{x}{\frac{t}{z \cdot z}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
Alternative 5
Accuracy72.5%
Cost1096
\[\begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{-71}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{-98}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-2 \cdot \frac{z}{\frac{a}{z} \cdot t}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
Alternative 6
Accuracy74.9%
Cost1092
\[\begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{-69}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}\right)\\ \end{array} \]
Alternative 7
Accuracy77.7%
Cost1092
\[\begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-309}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(\frac{a}{z} \cdot t\right) - z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}\right)\\ \end{array} \]
Alternative 8
Accuracy77.7%
Cost1092
\[\begin{array}{l} t_1 := \frac{a}{\frac{z}{t}}\\ \mathbf{if}\;z \leq 1.2 \cdot 10^{-296}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot t_1 - z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{z + -0.5 \cdot t_1}\right)\\ \end{array} \]
Alternative 9
Accuracy72.0%
Cost712
\[\begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-242}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-149}:\\ \;\;\;\;\frac{x}{\frac{z}{z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
Alternative 10
Accuracy73.3%
Cost712
\[\begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{-198}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{-76}:\\ \;\;\;\;\frac{y \cdot \left(z \cdot x\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
Alternative 11
Accuracy72.9%
Cost712
\[\begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{-59}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{-98}:\\ \;\;\;\;-1 + \left(1 - x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
Alternative 12
Accuracy70.2%
Cost388
\[\begin{array}{l} \mathbf{if}\;z \leq 7.6 \cdot 10^{-306}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
Alternative 13
Accuracy43.6%
Cost192
\[x \cdot y \]

Error

Reproduce?

herbie shell --seed 2023138 
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))

  (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))