?

Average Error: 28.5 → 9.9
Time: 40.6s
Precision: binary64
Cost: 3400

?

\[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
\[\begin{array}{l} t_1 := i + y \cdot \left(c + y \cdot \left(y \cdot \left(y + a\right) + b\right)\right)\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{+63}:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{+66}:\\ \;\;\;\;\frac{t}{t_1} + \frac{y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{t_1}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (/
  (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t)
  (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ i (* y (+ c (* y (+ (* y (+ y a)) b)))))))
   (if (<= y -6.2e+63)
     (+ x (- (/ z y) (* x (/ a y))))
     (if (<= y 9.6e+66)
       (+
        (/ t t_1)
        (/
         (* y (+ 230661.510616 (* y (+ 27464.7644705 (* y (+ z (* y x)))))))
         t_1))
       (+ x (/ z y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = i + (y * (c + (y * ((y * (y + a)) + b))));
	double tmp;
	if (y <= -6.2e+63) {
		tmp = x + ((z / y) - (x * (a / y)));
	} else if (y <= 9.6e+66) {
		tmp = (t / t_1) + ((y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x))))))) / t_1);
	} else {
		tmp = x + (z / y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = i + (y * (c + (y * ((y * (y + a)) + b))))
    if (y <= (-6.2d+63)) then
        tmp = x + ((z / y) - (x * (a / y)))
    else if (y <= 9.6d+66) then
        tmp = (t / t_1) + ((y * (230661.510616d0 + (y * (27464.7644705d0 + (y * (z + (y * x))))))) / t_1)
    else
        tmp = x + (z / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = i + (y * (c + (y * ((y * (y + a)) + b))));
	double tmp;
	if (y <= -6.2e+63) {
		tmp = x + ((z / y) - (x * (a / y)));
	} else if (y <= 9.6e+66) {
		tmp = (t / t_1) + ((y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x))))))) / t_1);
	} else {
		tmp = x + (z / y);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
def code(x, y, z, t, a, b, c, i):
	t_1 = i + (y * (c + (y * ((y * (y + a)) + b))))
	tmp = 0
	if y <= -6.2e+63:
		tmp = x + ((z / y) - (x * (a / y)))
	elif y <= 9.6e+66:
		tmp = (t / t_1) + ((y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x))))))) / t_1)
	else:
		tmp = x + (z / y)
	return tmp
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i))
end
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(i + Float64(y * Float64(c + Float64(y * Float64(Float64(y * Float64(y + a)) + b)))))
	tmp = 0.0
	if (y <= -6.2e+63)
		tmp = Float64(x + Float64(Float64(z / y) - Float64(x * Float64(a / y))));
	elseif (y <= 9.6e+66)
		tmp = Float64(Float64(t / t_1) + Float64(Float64(y * Float64(230661.510616 + Float64(y * Float64(27464.7644705 + Float64(y * Float64(z + Float64(y * x))))))) / t_1));
	else
		tmp = Float64(x + Float64(z / y));
	end
	return tmp
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = i + (y * (c + (y * ((y * (y + a)) + b))));
	tmp = 0.0;
	if (y <= -6.2e+63)
		tmp = x + ((z / y) - (x * (a / y)));
	elseif (y <= 9.6e+66)
		tmp = (t / t_1) + ((y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x))))))) / t_1);
	else
		tmp = x + (z / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i + N[(y * N[(c + N[(y * N[(N[(y * N[(y + a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+63], N[(x + N[(N[(z / y), $MachinePrecision] - N[(x * N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.6e+66], N[(N[(t / t$95$1), $MachinePrecision] + N[(N[(y * N[(230661.510616 + N[(y * N[(27464.7644705 + N[(y * N[(z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]]]]
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\begin{array}{l}
t_1 := i + y \cdot \left(c + y \cdot \left(y \cdot \left(y + a\right) + b\right)\right)\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+63}:\\
\;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\

\mathbf{elif}\;y \leq 9.6 \cdot 10^{+66}:\\
\;\;\;\;\frac{t}{t_1} + \frac{y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{t_1}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{z}{y}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 3 regimes
  2. if y < -6.2000000000000001e63

    1. Initial program 63.2

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Taylor expanded in y around inf 19.9

      \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}} \]
    3. Simplified16.7

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

      [Start]19.9

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

      +-commutative [=>]19.9

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

      associate--l+ [=>]19.9

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

      associate-/l* [=>]16.7

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

      associate-/r/ [=>]16.7

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

    if -6.2000000000000001e63 < y < 9.6000000000000007e66

    1. Initial program 5.5

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Taylor expanded in t around inf 5.5

      \[\leadsto \color{blue}{\frac{t}{y \cdot \left(c + y \cdot \left(\left(y + a\right) \cdot y + b\right)\right) + i} + \frac{\left(230661.510616 + y \cdot \left(27464.7644705 + \left(y \cdot x + z\right) \cdot y\right)\right) \cdot y}{y \cdot \left(c + y \cdot \left(\left(y + a\right) \cdot y + b\right)\right) + i}} \]

    if 9.6000000000000007e66 < y

    1. Initial program 62.9

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Taylor expanded in a around 0 63.0

      \[\leadsto \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{\left({y}^{2} + b\right) \cdot y} + c\right) \cdot y + i} \]
    3. Simplified63.0

      \[\leadsto \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{y \cdot \left(b + y \cdot y\right)} + c\right) \cdot y + i} \]
      Proof

      [Start]63.0

      \[ \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left({y}^{2} + b\right) \cdot y + c\right) \cdot y + i} \]

      *-commutative [=>]63.0

      \[ \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{y \cdot \left({y}^{2} + b\right)} + c\right) \cdot y + i} \]

      +-commutative [=>]63.0

      \[ \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(y \cdot \color{blue}{\left(b + {y}^{2}\right)} + c\right) \cdot y + i} \]

      unpow2 [=>]63.0

      \[ \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(y \cdot \left(b + \color{blue}{y \cdot y}\right) + c\right) \cdot y + i} \]
    4. Taylor expanded in y around inf 16.5

      \[\leadsto \color{blue}{\frac{z}{y} + x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{+63}:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{+66}:\\ \;\;\;\;\frac{t}{i + y \cdot \left(c + y \cdot \left(y \cdot \left(y + a\right) + b\right)\right)} + \frac{y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{i + y \cdot \left(c + y \cdot \left(y \cdot \left(y + a\right) + b\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]

Alternatives

Alternative 1
Error9.9
Cost2376
\[\begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+64}:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{+66}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{i + y \cdot \left(c + y \cdot \left(y \cdot \left(y + a\right) + b\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
Alternative 2
Error12.1
Cost2248
\[\begin{array}{l} \mathbf{if}\;y \leq -1.42 \cdot 10^{+65}:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+67}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
Alternative 3
Error13.0
Cost1992
\[\begin{array}{l} \mathbf{if}\;y \leq -3.25 \cdot 10^{+25}:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{+66}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + z \cdot \left(y \cdot y\right)\right)}{i + y \cdot \left(c + y \cdot \left(y \cdot \left(y + a\right) + b\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
Alternative 4
Error12.7
Cost1992
\[\begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+63}:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 8 \cdot 10^{+41}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{i + y \cdot \left(c + y \cdot b\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
Alternative 5
Error14.9
Cost1864
\[\begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{+63}:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+40}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot 27464.7644705\right)}{i + y \cdot \left(c + y \cdot \left(y \cdot \left(y + a\right) + b\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
Alternative 6
Error14.4
Cost1864
\[\begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+25}:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{+66}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + z \cdot \left(y \cdot y\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
Alternative 7
Error15.4
Cost1608
\[\begin{array}{l} \mathbf{if}\;y \leq -3.25 \cdot 10^{+25}:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+36}:\\ \;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot \left(c + y \cdot \left(y \cdot \left(y + a\right) + b\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
Alternative 8
Error16.2
Cost1480
\[\begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{+25}:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 6.7 \cdot 10^{+38}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot 27464.7644705\right)}{i + y \cdot \left(c + y \cdot b\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
Alternative 9
Error20.2
Cost1352
\[\begin{array}{l} \mathbf{if}\;y \leq -3.25 \cdot 10^{+25}:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+34}:\\ \;\;\;\;\frac{t}{i + y \cdot \left(c + y \cdot \left(y \cdot \left(y + a\right) + b\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
Alternative 10
Error25.3
Cost968
\[\begin{array}{l} \mathbf{if}\;y \leq -55000000:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{+25}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot 27464.7644705\right)}{i}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
Alternative 11
Error25.3
Cost841
\[\begin{array}{l} \mathbf{if}\;y \leq -1400000 \lor \neg \left(y \leq 2.95 \cdot 10^{+31}\right):\\ \;\;\;\;x + \frac{z}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{i} + \frac{y \cdot 230661.510616}{i}\\ \end{array} \]
Alternative 12
Error25.3
Cost840
\[\begin{array}{l} \mathbf{if}\;y \leq -340000:\\ \;\;\;\;x + \left(\frac{z}{y} - x \cdot \frac{a}{y}\right)\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+29}:\\ \;\;\;\;\frac{t}{i} + \frac{y \cdot 230661.510616}{i}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
Alternative 13
Error25.3
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -7400000 \lor \neg \left(y \leq 6.5 \cdot 10^{+25}\right):\\ \;\;\;\;x + \frac{z}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot 230661.510616}{i}\\ \end{array} \]
Alternative 14
Error27.5
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -56000 \lor \neg \left(y \leq 3.95 \cdot 10^{+28}\right):\\ \;\;\;\;x + \frac{z}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{i}\\ \end{array} \]
Alternative 15
Error32.4
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -3.05 \cdot 10^{+63}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{+66}:\\ \;\;\;\;\frac{t}{i}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 16
Error47.4
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023039 
(FPCore (x y z t a b c i)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2"
  :precision binary64
  (/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))