Average Error: 61.8 → 0.1
Time: 2.9s
Precision: binary64
\[0.9 \leq t \land t \leq 1.1\]
\[\left(1 + t \cdot 2 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 2 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right) \]
\[{\left(2.56 \cdot 10^{-126} \cdot {t}^{8}\right)}^{0.25} \]
(FPCore (t)
 :precision binary64
 (+ (* (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16))) (- -1.0 (* 2.0 (* t 2e-16)))))
(FPCore (t) :precision binary64 (pow (* 2.56e-126 (pow t 8.0)) 0.25))
double code(double t) {
	return ((1.0 + (t * 2e-16)) * (1.0 + (t * 2e-16))) + (-1.0 - (2.0 * (t * 2e-16)));
}
double code(double t) {
	return pow((2.56e-126 * pow(t, 8.0)), 0.25);
}
real(8) function code(t)
    real(8), intent (in) :: t
    code = ((1.0d0 + (t * 2d-16)) * (1.0d0 + (t * 2d-16))) + ((-1.0d0) - (2.0d0 * (t * 2d-16)))
end function
real(8) function code(t)
    real(8), intent (in) :: t
    code = (2.56d-126 * (t ** 8.0d0)) ** 0.25d0
end function
public static double code(double t) {
	return ((1.0 + (t * 2e-16)) * (1.0 + (t * 2e-16))) + (-1.0 - (2.0 * (t * 2e-16)));
}
public static double code(double t) {
	return Math.pow((2.56e-126 * Math.pow(t, 8.0)), 0.25);
}
def code(t):
	return ((1.0 + (t * 2e-16)) * (1.0 + (t * 2e-16))) + (-1.0 - (2.0 * (t * 2e-16)))
def code(t):
	return math.pow((2.56e-126 * math.pow(t, 8.0)), 0.25)
function code(t)
	return Float64(Float64(Float64(1.0 + Float64(t * 2e-16)) * Float64(1.0 + Float64(t * 2e-16))) + Float64(-1.0 - Float64(2.0 * Float64(t * 2e-16))))
end
function code(t)
	return Float64(2.56e-126 * (t ^ 8.0)) ^ 0.25
end
function tmp = code(t)
	tmp = ((1.0 + (t * 2e-16)) * (1.0 + (t * 2e-16))) + (-1.0 - (2.0 * (t * 2e-16)));
end
function tmp = code(t)
	tmp = (2.56e-126 * (t ^ 8.0)) ^ 0.25;
end
code[t_] := N[(N[(N[(1.0 + N[(t * 2e-16), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(t * 2e-16), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(2.0 * N[(t * 2e-16), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[t_] := N[Power[N[(2.56e-126 * N[Power[t, 8.0], $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision]
\left(1 + t \cdot 2 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 2 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right)
{\left(2.56 \cdot 10^{-126} \cdot {t}^{8}\right)}^{0.25}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original61.8
Target50.6
Herbie0.1
\[\mathsf{fma}\left(1 + t \cdot 2 \cdot 10^{-16}, 1 + t \cdot 2 \cdot 10^{-16}, -1 - 2 \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right) \]

Derivation

  1. Initial program 61.8

    \[\left(1 + t \cdot 2 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 2 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right) \]
  2. Simplified0.4

    \[\leadsto \color{blue}{t \cdot \left(t \cdot 4 \cdot 10^{-32}\right)} \]
  3. Taylor expanded in t around 0 0.4

    \[\leadsto \color{blue}{4 \cdot 10^{-32} \cdot {t}^{2}} \]
  4. Applied egg-rr0.2

    \[\leadsto \color{blue}{\sqrt{{t}^{4} \cdot 1.6 \cdot 10^{-63}}} \]
  5. Applied egg-rr0.2

    \[\leadsto \sqrt{\color{blue}{\sqrt{2.56 \cdot 10^{-126} \cdot {t}^{8}}}} \]
  6. Applied egg-rr0.1

    \[\leadsto \color{blue}{{\left(2.56 \cdot 10^{-126} \cdot {t}^{8}\right)}^{0.25}} \]
  7. Final simplification0.1

    \[\leadsto {\left(2.56 \cdot 10^{-126} \cdot {t}^{8}\right)}^{0.25} \]

Reproduce

herbie shell --seed 2022212 
(FPCore (t)
  :name "fma_test1"
  :precision binary64
  :pre (and (<= 0.9 t) (<= t 1.1))

  :herbie-target
  (fma (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16)) (- -1.0 (* 2.0 (* t 2e-16))))

  (+ (* (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16))) (- -1.0 (* 2.0 (* t 2e-16)))))