?

Average Error: 28.7 → 11.3
Time: 36.6s
Precision: binary64
Cost: 2376

?

\[\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 := \left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -4.1 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+65}:\\ \;\;\;\;\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}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 (- (+ (/ z y) x) (/ (* a x) y))))
   (if (<= y -4.1e+46)
     t_1
     (if (<= y 7e+65)
       (/
        (+
         (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
         t)
        (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
       t_1))))
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 = ((z / y) + x) - ((a * x) / y);
	double tmp;
	if (y <= -4.1e+46) {
		tmp = t_1;
	} else if (y <= 7e+65) {
		tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
	} else {
		tmp = t_1;
	}
	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 = ((z / y) + x) - ((a * x) / y)
    if (y <= (-4.1d+46)) then
        tmp = t_1
    else if (y <= 7d+65) then
        tmp = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
    else
        tmp = t_1
    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 = ((z / y) + x) - ((a * x) / y);
	double tmp;
	if (y <= -4.1e+46) {
		tmp = t_1;
	} else if (y <= 7e+65) {
		tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
	} else {
		tmp = t_1;
	}
	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 = ((z / y) + x) - ((a * x) / y)
	tmp = 0
	if y <= -4.1e+46:
		tmp = t_1
	elif y <= 7e+65:
		tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
	else:
		tmp = t_1
	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(Float64(Float64(z / y) + x) - Float64(Float64(a * x) / y))
	tmp = 0.0
	if (y <= -4.1e+46)
		tmp = t_1;
	elseif (y <= 7e+65)
		tmp = 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));
	else
		tmp = t_1;
	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 = ((z / y) + x) - ((a * x) / y);
	tmp = 0.0;
	if (y <= -4.1e+46)
		tmp = t_1;
	elseif (y <= 7e+65)
		tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
	else
		tmp = t_1;
	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[(N[(N[(z / y), $MachinePrecision] + x), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.1e+46], t$95$1, If[LessEqual[y, 7e+65], 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], t$95$1]]]
\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 := \left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -4.1 \cdot 10^{+46}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 7 \cdot 10^{+65}:\\
\;\;\;\;\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}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 2 regimes
  2. if y < -4.1e46 or 7.0000000000000002e65 < y

    1. Initial program 62.3

      \[\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 20.8

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

    if -4.1e46 < y < 7.0000000000000002e65

    1. Initial program 4.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} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification11.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+46}:\\ \;\;\;\;\left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+65}:\\ \;\;\;\;\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}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\ \end{array} \]

Alternatives

Alternative 1
Error13.8
Cost2252
\[\begin{array}{l} t_1 := \left(y + a\right) \cdot y + b\\ t_2 := \left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -8 \cdot 10^{+45}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-30}:\\ \;\;\;\;\frac{y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + \left(y \cdot x + z\right) \cdot y\right)\right) + t}{y \cdot \left(c + y \cdot t_1\right)}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+65}:\\ \;\;\;\;\frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(t_1 \cdot y + c\right) \cdot y + i}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error14.0
Cost2120
\[\begin{array}{l} t_1 := \left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -3.8 \cdot 10^{+31}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+65}:\\ \;\;\;\;\frac{\left(\left(y \cdot z + 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}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error16.3
Cost1996
\[\begin{array}{l} t_1 := \left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -9.5 \cdot 10^{+47}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-32}:\\ \;\;\;\;\frac{230661.510616 + y \cdot \left(27464.7644705 + \left(y \cdot x + z\right) \cdot y\right)}{c + \left(b + y \cdot \left(a + y\right)\right) \cdot y}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+65}:\\ \;\;\;\;\frac{\left(y \cdot 27464.7644705 + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error16.6
Cost1864
\[\begin{array}{l} t_1 := \left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -2.4 \cdot 10^{+48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-32}:\\ \;\;\;\;\frac{230661.510616 + y \cdot \left(27464.7644705 + \left(y \cdot x + z\right) \cdot y\right)}{c + \left(b + y \cdot \left(a + y\right)\right) \cdot y}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+65}:\\ \;\;\;\;\frac{y \cdot 230661.510616 + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error17.4
Cost1608
\[\begin{array}{l} t_1 := \left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -6.5 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+65}:\\ \;\;\;\;\frac{y \cdot 230661.510616 + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error21.9
Cost1352
\[\begin{array}{l} t_1 := \left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -1.75 \cdot 10^{+23}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+65}:\\ \;\;\;\;\frac{t}{y \cdot \left(c + y \cdot \left(\left(y + a\right) \cdot y + b\right)\right) + i}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error22.0
Cost1224
\[\begin{array}{l} t_1 := \left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -1.18 \cdot 10^{+24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+65}:\\ \;\;\;\;\frac{t}{y \cdot \left(c + y \cdot \left(y \cdot a + b\right)\right) + i}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error24.6
Cost968
\[\begin{array}{l} t_1 := \left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{+22}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+65}:\\ \;\;\;\;\frac{t}{y \cdot c + i}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error22.8
Cost968
\[\begin{array}{l} t_1 := \left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -5.7 \cdot 10^{+25}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+65}:\\ \;\;\;\;\frac{t}{y \cdot \left(c + y \cdot b\right) + i}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error27.9
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+65}:\\ \;\;\;\;\frac{t}{y \cdot c + i}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 11
Error46.5
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{-31}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{230661.510616}{c}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 12
Error32.7
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{+17}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-44}:\\ \;\;\;\;\frac{t}{i}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 13
Error47.5
Cost64
\[x \]

Error

Reproduce?

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