Average Error: 0.0 → 0.0
Time: 6.3s
Precision: binary64
\[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
\[\mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(z, 1 - y, a + \left(x - t \cdot a\right)\right)\right) \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
(FPCore (x y z t a b)
 :precision binary64
 (fma (+ y (+ t -2.0)) b (fma z (- 1.0 y) (+ a (- x (* t a))))))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
double code(double x, double y, double z, double t, double a, double b) {
	return fma((y + (t + -2.0)), b, fma(z, (1.0 - y), (a + (x - (t * a)))));
}
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b))
end
function code(x, y, z, t, a, b)
	return fma(Float64(y + Float64(t + -2.0)), b, fma(z, Float64(1.0 - y), Float64(a + Float64(x - Float64(t * a)))))
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_] := N[(N[(y + N[(t + -2.0), $MachinePrecision]), $MachinePrecision] * b + N[(z * N[(1.0 - y), $MachinePrecision] + N[(a + N[(x - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(z, 1 - y, a + \left(x - t \cdot a\right)\right)\right)

Error

Derivation

  1. Initial program 0.0

    \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(z, 1 - y, \mathsf{fma}\left(a, 1 - t, x\right)\right)\right)} \]
  3. Taylor expanded in t around 0 0.0

    \[\leadsto \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(z, 1 - y, \color{blue}{a + \left(-1 \cdot \left(a \cdot t\right) + x\right)}\right)\right) \]
  4. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(z, 1 - y, a + \left(x - t \cdot a\right)\right)\right) \]

Reproduce

herbie shell --seed 2022210 
(FPCore (x y z t a b)
  :name "Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2"
  :precision binary64
  (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))