?

Average Accuracy: 65.9% → 65.9%
Time: 15.6s
Precision: binary64
Cost: 576

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original65.9%
Target65.9%
Herbie65.9%
\[x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right) \]

Derivation?

  1. Initial program 66.8%

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Final simplification66.8%

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

Alternatives

Alternative 1
Accuracy52.4%
Cost1108
\[\begin{array}{l} t_1 := x + \left(y - z\right) \cdot t\\ t_2 := z \cdot \left(x - t\right)\\ \mathbf{if}\;z \leq -4.4 \cdot 10^{+16}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-169}:\\ \;\;\;\;x - y \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 1920000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+63}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Accuracy52.5%
Cost1108
\[\begin{array}{l} t_1 := x + \left(y - z\right) \cdot t\\ t_2 := z \cdot \left(x - t\right)\\ \mathbf{if}\;z \leq -1.85 \cdot 10^{-25}:\\ \;\;\;\;x + t_2\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-169}:\\ \;\;\;\;x - y \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 3900000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{+21}:\\ \;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\ \mathbf{elif}\;z \leq 1.52 \cdot 10^{+63}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Accuracy32.7%
Cost716
\[\begin{array}{l} t_1 := x + x \cdot z\\ \mathbf{if}\;x \leq -3.2 \cdot 10^{+87}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -3.8 \cdot 10^{-39}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-98}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Accuracy54.3%
Cost713
\[\begin{array}{l} \mathbf{if}\;t \leq -6.8 \cdot 10^{-153} \lor \neg \left(t \leq 5.5 \cdot 10^{-131}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\ \end{array} \]
Alternative 5
Accuracy27.1%
Cost653
\[\begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+216}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq -340000 \lor \neg \left(z \leq 11.5\right):\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 6
Accuracy36.5%
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -2.2 \lor \neg \left(z \leq 8.2 \cdot 10^{-5}\right):\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Accuracy47.7%
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{-9} \lor \neg \left(z \leq 0.0142\right):\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot t\\ \end{array} \]
Alternative 8
Accuracy26.6%
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-8}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
Alternative 9
Accuracy18.0%
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023157 
(FPCore (x y z t)
  :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
  :precision binary64

  :herbie-target
  (+ x (+ (* t (- y z)) (* (- x) (- y z))))

  (+ x (* (- y z) (- t x))))