?

Average Error: 0.0 → 0.0
Time: 26.5s
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
Error30.8
Cost1880
\[\begin{array}{l} t_1 := t \cdot \left(y - z\right)\\ \mathbf{if}\;y - z \leq -5 \cdot 10^{+178}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y - z \leq -1 \cdot 10^{+127}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y - z \leq -1 \cdot 10^{-27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y - z \leq -4 \cdot 10^{-102}:\\ \;\;\;\;x\\ \mathbf{elif}\;y - z \leq -2 \cdot 10^{-157}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y - z \leq 2 \cdot 10^{-110}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error26.0
Cost1376
\[\begin{array}{l} t_1 := \left(1 - y\right) \cdot x\\ t_2 := y \cdot \left(t - x\right)\\ t_3 := t \cdot \left(y - z\right)\\ t_4 := \left(1 + z\right) \cdot x\\ \mathbf{if}\;t \leq -6.8 \cdot 10^{-38}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq -1.36 \cdot 10^{-55}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq -4.5 \cdot 10^{-102}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -2.7 \cdot 10^{-157}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq -1.95 \cdot 10^{-165}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -1 \cdot 10^{-218}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.18 \cdot 10^{-290}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{-70}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 3
Error40.6
Cost1180
\[\begin{array}{l} t_1 := t \cdot \left(-z\right)\\ \mathbf{if}\;z \leq -1.9 \cdot 10^{+30}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-123}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-265}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-180}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-139}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-127}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-31}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error40.8
Cost1180
\[\begin{array}{l} t_1 := t \cdot \left(-z\right)\\ \mathbf{if}\;z \leq -6.5 \cdot 10^{+29}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-123}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-266}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-172}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-141}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-128}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-28}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error29.7
Cost980
\[\begin{array}{l} t_1 := t \cdot \left(y - z\right)\\ t_2 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -65000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-17}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-263}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-128}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+132}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error23.5
Cost848
\[\begin{array}{l} t_1 := \left(1 + z\right) \cdot x\\ \mathbf{if}\;x \leq -1.95:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.8 \cdot 10^{-52}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;x \leq -2.25 \cdot 10^{-67}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-29}:\\ \;\;\;\;t \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error20.0
Cost848
\[\begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -70000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{-107}:\\ \;\;\;\;\left(1 + z\right) \cdot x\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-104}:\\ \;\;\;\;x + t \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+131}:\\ \;\;\;\;t \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error38.7
Cost720
\[\begin{array}{l} \mathbf{if}\;y \leq -150000:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1.08 \cdot 10^{-17}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq -8 \cdot 10^{-28}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-104}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
Alternative 9
Error16.9
Cost712
\[\begin{array}{l} t_1 := x \cdot \left(z - \left(y - 1\right)\right)\\ \mathbf{if}\;x \leq -2.3 \cdot 10^{-85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-30}:\\ \;\;\;\;t \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error11.4
Cost712
\[\begin{array}{l} t_1 := x + t \cdot \left(y - z\right)\\ \mathbf{if}\;t \leq -1.4 \cdot 10^{-82}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-113}:\\ \;\;\;\;x \cdot \left(z - \left(y - 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error38.5
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -7.6 \cdot 10^{-28}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-104}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
Alternative 12
Error47.2
Cost64
\[x \]

Error

Reproduce?

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