?

Average Error: 0.0 → 0.0
Time: 13.7s
Precision: binary64
Cost: 1984

?

\[\frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}} \]
\[\begin{array}{l} t_1 := \frac{t}{1 + t}\\ t_2 := t_1 \cdot \left(t_1 \cdot 4\right)\\ \frac{1 + t_2}{2 + t_2} \end{array} \]
(FPCore (t)
 :precision binary64
 (/
  (+ 1.0 (* (/ (* 2.0 t) (+ 1.0 t)) (/ (* 2.0 t) (+ 1.0 t))))
  (+ 2.0 (* (/ (* 2.0 t) (+ 1.0 t)) (/ (* 2.0 t) (+ 1.0 t))))))
(FPCore (t)
 :precision binary64
 (let* ((t_1 (/ t (+ 1.0 t))) (t_2 (* t_1 (* t_1 4.0))))
   (/ (+ 1.0 t_2) (+ 2.0 t_2))))
double code(double t) {
	return (1.0 + (((2.0 * t) / (1.0 + t)) * ((2.0 * t) / (1.0 + t)))) / (2.0 + (((2.0 * t) / (1.0 + t)) * ((2.0 * t) / (1.0 + t))));
}
double code(double t) {
	double t_1 = t / (1.0 + t);
	double t_2 = t_1 * (t_1 * 4.0);
	return (1.0 + t_2) / (2.0 + t_2);
}
real(8) function code(t)
    real(8), intent (in) :: t
    code = (1.0d0 + (((2.0d0 * t) / (1.0d0 + t)) * ((2.0d0 * t) / (1.0d0 + t)))) / (2.0d0 + (((2.0d0 * t) / (1.0d0 + t)) * ((2.0d0 * t) / (1.0d0 + t))))
end function
real(8) function code(t)
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    t_1 = t / (1.0d0 + t)
    t_2 = t_1 * (t_1 * 4.0d0)
    code = (1.0d0 + t_2) / (2.0d0 + t_2)
end function
public static double code(double t) {
	return (1.0 + (((2.0 * t) / (1.0 + t)) * ((2.0 * t) / (1.0 + t)))) / (2.0 + (((2.0 * t) / (1.0 + t)) * ((2.0 * t) / (1.0 + t))));
}
public static double code(double t) {
	double t_1 = t / (1.0 + t);
	double t_2 = t_1 * (t_1 * 4.0);
	return (1.0 + t_2) / (2.0 + t_2);
}
def code(t):
	return (1.0 + (((2.0 * t) / (1.0 + t)) * ((2.0 * t) / (1.0 + t)))) / (2.0 + (((2.0 * t) / (1.0 + t)) * ((2.0 * t) / (1.0 + t))))
def code(t):
	t_1 = t / (1.0 + t)
	t_2 = t_1 * (t_1 * 4.0)
	return (1.0 + t_2) / (2.0 + t_2)
function code(t)
	return Float64(Float64(1.0 + Float64(Float64(Float64(2.0 * t) / Float64(1.0 + t)) * Float64(Float64(2.0 * t) / Float64(1.0 + t)))) / Float64(2.0 + Float64(Float64(Float64(2.0 * t) / Float64(1.0 + t)) * Float64(Float64(2.0 * t) / Float64(1.0 + t)))))
end
function code(t)
	t_1 = Float64(t / Float64(1.0 + t))
	t_2 = Float64(t_1 * Float64(t_1 * 4.0))
	return Float64(Float64(1.0 + t_2) / Float64(2.0 + t_2))
end
function tmp = code(t)
	tmp = (1.0 + (((2.0 * t) / (1.0 + t)) * ((2.0 * t) / (1.0 + t)))) / (2.0 + (((2.0 * t) / (1.0 + t)) * ((2.0 * t) / (1.0 + t))));
end
function tmp = code(t)
	t_1 = t / (1.0 + t);
	t_2 = t_1 * (t_1 * 4.0);
	tmp = (1.0 + t_2) / (2.0 + t_2);
end
code[t_] := N[(N[(1.0 + N[(N[(N[(2.0 * t), $MachinePrecision] / N[(1.0 + t), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * t), $MachinePrecision] / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[(N[(N[(2.0 * t), $MachinePrecision] / N[(1.0 + t), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * t), $MachinePrecision] / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[t_] := Block[{t$95$1 = N[(t / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(t$95$1 * 4.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(1.0 + t$95$2), $MachinePrecision] / N[(2.0 + t$95$2), $MachinePrecision]), $MachinePrecision]]]
\frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}
\begin{array}{l}
t_1 := \frac{t}{1 + t}\\
t_2 := t_1 \cdot \left(t_1 \cdot 4\right)\\
\frac{1 + t_2}{2 + t_2}
\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.0

    \[\frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}} \]
  2. Simplified0.0

    \[\leadsto \color{blue}{\frac{1 + \frac{t}{1 + t} \cdot \left(\frac{t}{1 + t} \cdot 4\right)}{2 + \frac{t}{1 + t} \cdot \left(\frac{t}{1 + t} \cdot 4\right)}} \]
    Proof

    [Start]0.0

    \[ \frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}} \]

    rational.json-simplify-2 [=>]0.0

    \[ \frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{\color{blue}{t \cdot 2}}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}} \]

    rational.json-simplify-49 [=>]0.0

    \[ \frac{1 + \frac{2 \cdot t}{1 + t} \cdot \color{blue}{\left(2 \cdot \frac{t}{1 + t}\right)}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}} \]

    rational.json-simplify-2 [=>]0.0

    \[ \frac{1 + \frac{2 \cdot t}{1 + t} \cdot \color{blue}{\left(\frac{t}{1 + t} \cdot 2\right)}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}} \]

    rational.json-simplify-43 [=>]0.0

    \[ \frac{1 + \color{blue}{\frac{t}{1 + t} \cdot \left(2 \cdot \frac{2 \cdot t}{1 + t}\right)}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}} \]

    rational.json-simplify-2 [=>]0.0

    \[ \frac{1 + \frac{t}{1 + t} \cdot \left(2 \cdot \frac{\color{blue}{t \cdot 2}}{1 + t}\right)}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}} \]

    rational.json-simplify-49 [=>]0.0

    \[ \frac{1 + \frac{t}{1 + t} \cdot \left(2 \cdot \color{blue}{\left(2 \cdot \frac{t}{1 + t}\right)}\right)}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}} \]

    rational.json-simplify-2 [=>]0.0

    \[ \frac{1 + \frac{t}{1 + t} \cdot \left(2 \cdot \color{blue}{\left(\frac{t}{1 + t} \cdot 2\right)}\right)}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}} \]

    rational.json-simplify-43 [=>]0.0

    \[ \frac{1 + \frac{t}{1 + t} \cdot \color{blue}{\left(\frac{t}{1 + t} \cdot \left(2 \cdot 2\right)\right)}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}} \]

    metadata-eval [=>]0.0

    \[ \frac{1 + \frac{t}{1 + t} \cdot \left(\frac{t}{1 + t} \cdot \color{blue}{4}\right)}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}} \]

    rational.json-simplify-2 [=>]0.0

    \[ \frac{1 + \frac{t}{1 + t} \cdot \left(\frac{t}{1 + t} \cdot 4\right)}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{\color{blue}{t \cdot 2}}{1 + t}} \]

    rational.json-simplify-49 [=>]0.0

    \[ \frac{1 + \frac{t}{1 + t} \cdot \left(\frac{t}{1 + t} \cdot 4\right)}{2 + \frac{2 \cdot t}{1 + t} \cdot \color{blue}{\left(2 \cdot \frac{t}{1 + t}\right)}} \]

    rational.json-simplify-2 [=>]0.0

    \[ \frac{1 + \frac{t}{1 + t} \cdot \left(\frac{t}{1 + t} \cdot 4\right)}{2 + \frac{2 \cdot t}{1 + t} \cdot \color{blue}{\left(\frac{t}{1 + t} \cdot 2\right)}} \]

    rational.json-simplify-43 [=>]0.0

    \[ \frac{1 + \frac{t}{1 + t} \cdot \left(\frac{t}{1 + t} \cdot 4\right)}{2 + \color{blue}{\frac{t}{1 + t} \cdot \left(2 \cdot \frac{2 \cdot t}{1 + t}\right)}} \]
  3. Final simplification0.0

    \[\leadsto \frac{1 + \frac{t}{1 + t} \cdot \left(\frac{t}{1 + t} \cdot 4\right)}{2 + \frac{t}{1 + t} \cdot \left(\frac{t}{1 + t} \cdot 4\right)} \]

Alternatives

Alternative 1
Error0.5
Cost1224
\[\begin{array}{l} t_1 := 0.8333333333333334 - \frac{0.2222222222222222}{t}\\ \mathbf{if}\;t \leq -1.15:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 0.88:\\ \;\;\;\;\frac{1}{1 + \frac{1}{1 + \frac{t}{0.25 + \frac{0.25}{t}}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error0.6
Cost840
\[\begin{array}{l} t_1 := 0.8333333333333334 - \frac{0.2222222222222222}{t}\\ \mathbf{if}\;t \leq -0.58:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 0.48:\\ \;\;\;\;\frac{1 + t \cdot \left(t \cdot 4\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error0.6
Cost584
\[\begin{array}{l} t_1 := 0.8333333333333334 - \frac{0.2222222222222222}{t}\\ \mathbf{if}\;t \leq -0.49:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 0.66:\\ \;\;\;\;0.5\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error1.0
Cost328
\[\begin{array}{l} \mathbf{if}\;t \leq -0.33:\\ \;\;\;\;0.8333333333333334\\ \mathbf{elif}\;t \leq 1:\\ \;\;\;\;0.5\\ \mathbf{else}:\\ \;\;\;\;0.8333333333333334\\ \end{array} \]
Alternative 5
Error26.5
Cost64
\[0.5 \]

Error

Reproduce?

herbie shell --seed 2023075 
(FPCore (t)
  :name "Kahan p13 Example 1"
  :precision binary64
  (/ (+ 1.0 (* (/ (* 2.0 t) (+ 1.0 t)) (/ (* 2.0 t) (+ 1.0 t)))) (+ 2.0 (* (/ (* 2.0 t) (+ 1.0 t)) (/ (* 2.0 t) (+ 1.0 t))))))