?

Average Accuracy: 66.0% → 66.0%
Time: 12.7s
Precision: binary64
Cost: 960

?

\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
\[\left(z \cdot a\right) \cdot b + \left(t \cdot a + \left(x + y \cdot z\right)\right) \]
(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
 (+ (* (* z a) b) (+ (* t a) (+ x (* y z)))))
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 ((z * a) * b) + ((t * a) + (x + (y * z)));
}
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 = ((z * a) * b) + ((t * a) + (x + (y * z)))
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 ((z * a) * b) + ((t * a) + (x + (y * z)));
}
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 ((z * a) * b) + ((t * a) + (x + (y * z)))
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(z * a) * b) + Float64(Float64(t * a) + Float64(x + Float64(y * z))))
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 = ((z * a) * b) + ((t * a) + (x + (y * z)));
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[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\left(z \cdot a\right) \cdot b + \left(t \cdot a + \left(x + y \cdot z\right)\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original66.0%
Target67.9%
Herbie66.0%
\[\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 65.5%

    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
  2. Final simplification65.5%

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

Alternatives

Alternative 1
Accuracy32.8%
Cost1380
\[\begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;x \leq -6.8 \cdot 10^{+62}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -4.2 \cdot 10^{-70}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq -1.75 \cdot 10^{-181}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq -4.2 \cdot 10^{-276}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq -4 \cdot 10^{-303}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-298}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 6.4 \cdot 10^{-201}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-104}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{+24}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 2
Accuracy60.4%
Cost1097
\[\begin{array}{l} \mathbf{if}\;x \leq -9.2 \cdot 10^{-151} \lor \neg \left(x \leq 6.4 \cdot 10^{-13}\right):\\ \;\;\;\;t \cdot a + \left(x + y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b + \left(t \cdot a + y \cdot z\right)\\ \end{array} \]
Alternative 3
Accuracy65.0%
Cost960
\[\left(a \cdot \left(z \cdot b\right) + t \cdot a\right) + \left(x + y \cdot z\right) \]
Alternative 4
Accuracy43.3%
Cost848
\[\begin{array}{l} t_1 := x + y \cdot z\\ t_2 := x + t \cdot a\\ \mathbf{if}\;t \leq -1.75 \cdot 10^{+105}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -8.2 \cdot 10^{-224}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-122}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;t \leq 7.4 \cdot 10^{-53}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Accuracy42.2%
Cost848
\[\begin{array}{l} t_1 := x + y \cdot z\\ \mathbf{if}\;t \leq -2.1 \cdot 10^{+197}:\\ \;\;\;\;t \cdot a + y \cdot z\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-222}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{-122}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-54}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \]
Alternative 6
Accuracy54.4%
Cost841
\[\begin{array}{l} \mathbf{if}\;a \leq -9 \cdot 10^{-39} \lor \neg \left(a \leq 1.05 \cdot 10^{-177}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]
Alternative 7
Accuracy60.2%
Cost841
\[\begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{-71} \lor \neg \left(y \leq 1.92 \cdot 10^{-56}\right):\\ \;\;\;\;t \cdot a + \left(x + y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
Alternative 8
Accuracy33.9%
Cost720
\[\begin{array}{l} \mathbf{if}\;x \leq -9.8 \cdot 10^{+61}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -3 \cdot 10^{-64}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-181}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 7 \cdot 10^{+24}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Accuracy40.9%
Cost717
\[\begin{array}{l} \mathbf{if}\;y \leq -95000 \lor \neg \left(y \leq 7.3 \cdot 10^{+143}\right) \land y \leq 2.1 \cdot 10^{+231}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \]
Alternative 10
Accuracy47.7%
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -8.8 \cdot 10^{-44} \lor \neg \left(y \leq 5.2 \cdot 10^{-65}\right):\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \]
Alternative 11
Accuracy33.3%
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{-81}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{-107}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 12
Accuracy26.5%
Cost64
\[x \]

Error

Reproduce?

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