Average Error: 0.6 → 0.6
Time: 12.5s
Precision: binary64
Cost: 704
\[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
\[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
	return 1.0 - (x / ((y - z) * (y - t)));
}
double code(double x, double y, double z, double t) {
	return 1.0 - (x / ((y - z) * (y - t)));
}
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 = 1.0d0 - (x / ((y - z) * (y - t)))
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 = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
	return 1.0 - (x / ((y - z) * (y - t)));
}
public static double code(double x, double y, double z, double t) {
	return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t):
	return 1.0 - (x / ((y - z) * (y - t)))
def code(x, y, z, t):
	return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t)
	return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t))))
end
function code(x, y, z, t)
	return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t))))
end
function tmp = code(x, y, z, t)
	tmp = 1.0 - (x / ((y - z) * (y - t)));
end
function tmp = code(x, y, z, t)
	tmp = 1.0 - (x / ((y - z) * (y - t)));
end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.6

    \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
  2. Final simplification0.6

    \[\leadsto 1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]

Alternatives

Alternative 1
Error10.8
Cost1104
\[\begin{array}{l} \mathbf{if}\;y \leq -1.1706683326237428 \cdot 10^{-12}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-149}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \mathbf{elif}\;y \leq 1.0132973802072265 \cdot 10^{-13}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 2.8779568980174104 \cdot 10^{+80}:\\ \;\;\;\;1 + \frac{-1}{\frac{y \cdot y}{x}}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 2
Error11.1
Cost976
\[\begin{array}{l} \mathbf{if}\;y \leq -1.1706683326237428 \cdot 10^{-12}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-149}:\\ \;\;\;\;1 - \frac{\frac{x}{z}}{t}\\ \mathbf{elif}\;y \leq 1.0132973802072265 \cdot 10^{-13}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 2.8779568980174104 \cdot 10^{+80}:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 3
Error10.8
Cost976
\[\begin{array}{l} \mathbf{if}\;y \leq -1.1706683326237428 \cdot 10^{-12}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-149}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \mathbf{elif}\;y \leq 1.0132973802072265 \cdot 10^{-13}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 2.8779568980174104 \cdot 10^{+80}:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 4
Error9.1
Cost972
\[\begin{array}{l} \mathbf{if}\;y \leq -1.8341197108874627 \cdot 10^{-74}:\\ \;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-160}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \mathbf{elif}\;y \leq 4.0288274834137 \cdot 10^{-64}:\\ \;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\ \end{array} \]
Alternative 5
Error9.1
Cost840
\[\begin{array}{l} t_1 := 1 - \frac{\frac{x}{y - t}}{y}\\ \mathbf{if}\;y \leq -1.8341197108874627 \cdot 10^{-74}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-160}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error9.1
Cost840
\[\begin{array}{l} \mathbf{if}\;y \leq -1.8341197108874627 \cdot 10^{-74}:\\ \;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-160}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\ \end{array} \]
Alternative 7
Error13.8
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq 1.344813327940926 \cdot 10^{-263}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 4.969678022137834 \cdot 10^{-30}:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 8
Error10.8
Cost708
\[\begin{array}{l} \mathbf{if}\;z \leq -1.7241451209207663 \cdot 10^{-109}:\\ \;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\ \end{array} \]
Alternative 9
Error1.1
Cost704
\[1 + \frac{\frac{x}{y - z}}{t - y} \]
Alternative 10
Error13.1
Cost64
\[1 \]

Error

Reproduce

herbie shell --seed 2022308 
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
  :precision binary64
  (- 1.0 (/ x (* (- y z) (- y t)))))