Average Error: 0.1 → 0.1
Time: 4.4s
Precision: binary64
Cost: 320
\[\frac{841}{108} \cdot x + \frac{4}{29} \]
\[0.13793103448275862 + 7.787037037037037 \cdot x \]
(FPCore (x) :precision binary64 (+ (* (/ 841.0 108.0) x) (/ 4.0 29.0)))
(FPCore (x)
 :precision binary64
 (+ 0.13793103448275862 (* 7.787037037037037 x)))
double code(double x) {
	return ((841.0 / 108.0) * x) + (4.0 / 29.0);
}
double code(double x) {
	return 0.13793103448275862 + (7.787037037037037 * x);
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = ((841.0d0 / 108.0d0) * x) + (4.0d0 / 29.0d0)
end function
real(8) function code(x)
    real(8), intent (in) :: x
    code = 0.13793103448275862d0 + (7.787037037037037d0 * x)
end function
public static double code(double x) {
	return ((841.0 / 108.0) * x) + (4.0 / 29.0);
}
public static double code(double x) {
	return 0.13793103448275862 + (7.787037037037037 * x);
}
def code(x):
	return ((841.0 / 108.0) * x) + (4.0 / 29.0)
def code(x):
	return 0.13793103448275862 + (7.787037037037037 * x)
function code(x)
	return Float64(Float64(Float64(841.0 / 108.0) * x) + Float64(4.0 / 29.0))
end
function code(x)
	return Float64(0.13793103448275862 + Float64(7.787037037037037 * x))
end
function tmp = code(x)
	tmp = ((841.0 / 108.0) * x) + (4.0 / 29.0);
end
function tmp = code(x)
	tmp = 0.13793103448275862 + (7.787037037037037 * x);
end
code[x_] := N[(N[(N[(841.0 / 108.0), $MachinePrecision] * x), $MachinePrecision] + N[(4.0 / 29.0), $MachinePrecision]), $MachinePrecision]
code[x_] := N[(0.13793103448275862 + N[(7.787037037037037 * x), $MachinePrecision]), $MachinePrecision]
\frac{841}{108} \cdot x + \frac{4}{29}
0.13793103448275862 + 7.787037037037037 \cdot x

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\frac{841}{108} \cdot x + \frac{4}{29} \]
  2. Taylor expanded in x around 0 0.1

    \[\leadsto \color{blue}{0.13793103448275862 + 7.787037037037037 \cdot x} \]
  3. Final simplification0.1

    \[\leadsto 0.13793103448275862 + 7.787037037037037 \cdot x \]

Alternatives

Alternative 1
Error1.5
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -4.405786177188472:\\ \;\;\;\;7.787037037037037 \cdot x\\ \mathbf{elif}\;x \leq 7.324045184595973 \cdot 10^{-6}:\\ \;\;\;\;0.13793103448275862\\ \mathbf{else}:\\ \;\;\;\;7.787037037037037 \cdot x\\ \end{array} \]
Alternative 2
Error31.8
Cost64
\[0.13793103448275862 \]

Error

Reproduce

herbie shell --seed 2022228 
(FPCore (x)
  :name "Data.Colour.CIE:cieLABView from colour-2.3.3, A"
  :precision binary64
  (+ (* (/ 841.0 108.0) x) (/ 4.0 29.0)))