Average Error: 0.0 → 0.0
Time: 10.7s
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

Original0.0
Target0.0
Herbie0.0
\[x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right) \]

Derivation

  1. Initial program 0.0

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Final simplification0.0

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

Alternatives

Alternative 1
Error17.2
Cost1637
\[\begin{array}{l} t_1 := x + \left(y - z\right) \cdot t\\ t_2 := x + x \cdot \left(z - y\right)\\ \mathbf{if}\;y \leq -2.05 \cdot 10^{+188}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{+163}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{+109}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{+45}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3600000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-94}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.65 \cdot 10^{-137}:\\ \;\;\;\;x + z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{+47} \lor \neg \left(y \leq 3.7 \cdot 10^{+177}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error40.4
Cost1180
\[\begin{array}{l} t_1 := x \cdot \left(-y\right)\\ t_2 := z \cdot \left(-t\right)\\ \mathbf{if}\;y \leq -2300:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{-22}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.85 \cdot 10^{-244}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-147}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-104}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-45}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 43000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error28.0
Cost849
\[\begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -1.75 \cdot 10^{-12}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-37}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+50} \lor \neg \left(z \leq 7.7 \cdot 10^{+112}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot z\\ \end{array} \]
Alternative 4
Error10.7
Cost844
\[\begin{array}{l} t_1 := x + y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -58000000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-97}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-57}:\\ \;\;\;\;x + z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error27.4
Cost717
\[\begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{+185}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq -6.4 \cdot 10^{-111} \lor \neg \left(y \leq 1.65 \cdot 10^{-61}\right):\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot t\\ \end{array} \]
Alternative 6
Error17.9
Cost713
\[\begin{array}{l} \mathbf{if}\;t \leq -4.5 \cdot 10^{-128} \lor \neg \left(t \leq 3 \cdot 10^{-222}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot y\\ \end{array} \]
Alternative 7
Error11.3
Cost713
\[\begin{array}{l} \mathbf{if}\;t \leq -2.6 \cdot 10^{-126} \lor \neg \left(t \leq 3.8 \cdot 10^{-114}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot \left(z - y\right)\\ \end{array} \]
Alternative 8
Error28.0
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{-7} \lor \neg \left(z \leq 7 \cdot 10^{-37}\right):\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot t\\ \end{array} \]
Alternative 9
Error38.7
Cost521
\[\begin{array}{l} \mathbf{if}\;y \leq -0.11 \lor \neg \left(y \leq 43000\right):\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 10
Error47.6
Cost64
\[x \]

Error

Reproduce

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