?

Average Error: 2.1 → 2.1
Time: 11.0s
Precision: binary64
Cost: 960

?

\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
\[\left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
(FPCore (x y z t a b)
 :precision binary64
 (+ (+ (* t a) (+ x (* y z))) (* (* z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
double code(double x, double y, double z, double t, double a, double b) {
	return ((t * a) + (x + (y * z))) + ((z * a) * b);
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = ((t * a) + (x + (y * z))) + ((z * a) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((t * a) + (x + (y * z))) + ((z * a) * b);
}
def code(x, y, z, t, a, b):
	return ((x + (y * z)) + (t * a)) + ((a * z) * b)
def code(x, y, z, t, a, b):
	return ((t * a) + (x + (y * z))) + ((z * a) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b))
end
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(Float64(z * a) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b);
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((t * a) + (x + (y * z))) + ((z * a) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.1
Target0.3
Herbie2.1
\[\begin{array}{l} \mathbf{if}\;z < -11820553527347888000:\\ \;\;\;\;z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\ \;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \end{array} \]

Derivation?

  1. Initial program 2.1

    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
  2. Final simplification2.1

    \[\leadsto \left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b \]

Alternatives

Alternative 1
Error21.8
Cost1636
\[\begin{array}{l} t_1 := x + y \cdot z\\ t_2 := z \cdot \left(y + a \cdot b\right)\\ t_3 := x + t \cdot a\\ \mathbf{if}\;y \leq -1.35 \cdot 10^{+91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -5 \cdot 10^{+75}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-62}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -5.4 \cdot 10^{-213}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-175}:\\ \;\;\;\;x + \left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;y \leq 1.22 \cdot 10^{-29}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+15}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{+68}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{+92}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error28.1
Cost1376
\[\begin{array}{l} t_1 := x + t \cdot a\\ \mathbf{if}\;a \leq -1.3 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -4.6 \cdot 10^{+31}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;a \leq -4.1 \cdot 10^{-53}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -9.5 \cdot 10^{-109}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 8 \cdot 10^{-266}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{-234}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 7 \cdot 10^{+196}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.4 \cdot 10^{+289}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]
Alternative 3
Error33.4
Cost1248
\[\begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{+51}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -9 \cdot 10^{-181}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-262}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 7.6 \cdot 10^{-227}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-201}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-173}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-103}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{+25}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 4
Error21.2
Cost1112
\[\begin{array}{l} t_1 := x + t \cdot a\\ \mathbf{if}\;a \leq -1.25 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -4.6 \cdot 10^{+31}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;a \leq -4.5 \cdot 10^{-53}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 3 \cdot 10^{-174}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{+195}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{+283}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]
Alternative 5
Error20.4
Cost1108
\[\begin{array}{l} t_1 := x + t \cdot a\\ t_2 := a \cdot \left(t + z \cdot b\right)\\ \mathbf{if}\;a \leq -3.9 \cdot 10^{+31}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -7 \cdot 10^{-50}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -5.5 \cdot 10^{-61}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 9 \cdot 10^{-174}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error9.5
Cost1105
\[\begin{array}{l} t_1 := x + z \cdot \left(y + a \cdot b\right)\\ \mathbf{if}\;z \leq -9.5 \cdot 10^{-33}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-60}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-76} \lor \neg \left(z \leq 1.08 \cdot 10^{-85}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(x + t \cdot a\right) + y \cdot z\\ \end{array} \]
Alternative 7
Error2.4
Cost1092
\[\begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+126}:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(z \cdot b\right) + t \cdot a\right) + \left(x + y \cdot z\right)\\ \end{array} \]
Alternative 8
Error33.3
Cost984
\[\begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{+51}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -3.35 \cdot 10^{-180}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-262}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-173}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-105}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{+26}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Error10.1
Cost708
\[\begin{array}{l} \mathbf{if}\;b \leq 2 \cdot 10^{+160}:\\ \;\;\;\;\left(x + t \cdot a\right) + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \left(z \cdot a\right) \cdot b\\ \end{array} \]
Alternative 10
Error33.4
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -5.8 \cdot 10^{+28}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{+61}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 11
Error39.9
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023046 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :herbie-target
  (if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))

  (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))