?

Average Error: 0.1 → 0.1
Time: 6.5s
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} \cdot \frac{t \cdot 4}{1 + t}\\ \frac{1 + t_1}{2 + t_1} \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 4.0) (+ 1.0 t)))))
   (/ (+ 1.0 t_1) (+ 2.0 t_1))))
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)) * ((t * 4.0) / (1.0 + t));
	return (1.0 + t_1) / (2.0 + t_1);
}
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
    t_1 = (t / (1.0d0 + t)) * ((t * 4.0d0) / (1.0d0 + t))
    code = (1.0d0 + t_1) / (2.0d0 + t_1)
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)) * ((t * 4.0) / (1.0 + t));
	return (1.0 + t_1) / (2.0 + t_1);
}
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 * 4.0) / (1.0 + t))
	return (1.0 + t_1) / (2.0 + t_1)
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(Float64(t / Float64(1.0 + t)) * Float64(Float64(t * 4.0) / Float64(1.0 + t)))
	return Float64(Float64(1.0 + t_1) / Float64(2.0 + t_1))
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 * 4.0) / (1.0 + t));
	tmp = (1.0 + t_1) / (2.0 + t_1);
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[(N[(t / N[(1.0 + t), $MachinePrecision]), $MachinePrecision] * N[(N[(t * 4.0), $MachinePrecision] / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(1.0 + t$95$1), $MachinePrecision] / N[(2.0 + t$95$1), $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} \cdot \frac{t \cdot 4}{1 + t}\\
\frac{1 + t_1}{2 + t_1}
\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.1

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

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

    [Start]0.1

    \[ \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_best-simplify-105 [=>]16.2

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

    rational_best-simplify-3 [=>]16.2

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

    rational_best-simplify-113 [=>]16.2

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

    rational_best-simplify-104 [=>]0.1

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

    rational_best-simplify-3 [=>]0.1

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

    rational_best-simplify-3 [=>]0.1

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

    rational_best-simplify-113 [=>]0.1

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

    metadata-eval [=>]0.1

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

    rational_best-simplify-105 [=>]16.2

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

    rational_best-simplify-3 [=>]16.2

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

    rational_best-simplify-113 [=>]16.2

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

    rational_best-simplify-104 [=>]0.1

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

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

Alternatives

Alternative 1
Error1.4
Cost1728
\[\begin{array}{l} t_1 := \frac{t \cdot 4}{1 + t}\\ \frac{1 + \frac{t}{1 + t} \cdot t_1}{2 + 1 \cdot t_1} \end{array} \]
Alternative 2
Error0.4
Cost1608
\[\begin{array}{l} t_1 := \frac{0.2222222222222222}{t} + -0.8333333333333334\\ t_2 := 0.8333333333333334 - \frac{0.2222222222222222}{t}\\ \mathbf{if}\;t \leq -0.56:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;t_1 \ne 0:\\ \;\;\;\;\frac{t_1 \cdot t_2}{t_1}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array}\\ \mathbf{elif}\;t \leq 0.75:\\ \;\;\;\;\frac{1 + \frac{t}{1 + t} \cdot \left(4 \cdot t\right)}{2 + t \cdot \left(4 \cdot t\right)}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error0.4
Cost1480
\[\begin{array}{l} t_1 := 0.8333333333333334 - \frac{0.2222222222222222}{t}\\ \mathbf{if}\;t \leq -0.56:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 0.75:\\ \;\;\;\;\frac{1 + \frac{t}{1 + t} \cdot \left(4 \cdot t\right)}{2 + t \cdot \left(4 \cdot t\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error0.6
Cost584
\[\begin{array}{l} t_1 := 0.8333333333333334 - \frac{0.2222222222222222}{t}\\ \mathbf{if}\;t \leq -0.5:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 0.65:\\ \;\;\;\;0.5\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error1.0
Cost328
\[\begin{array}{l} \mathbf{if}\;t \leq -0.34:\\ \;\;\;\;0.8333333333333334\\ \mathbf{elif}\;t \leq 1:\\ \;\;\;\;0.5\\ \mathbf{else}:\\ \;\;\;\;0.8333333333333334\\ \end{array} \]
Alternative 6
Error26.2
Cost64
\[0.5 \]

Error

Reproduce?

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