?

Average Error: 0.6 → 1.2
Time: 11.2s
Precision: binary64
Cost: 704

?

\[ \begin{array}{c}[z, t] = \mathsf{sort}([z, t])\\ \end{array} \]
\[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
\[1 - \frac{\frac{x}{y - z}}{y - t} \]
(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(Float64(x / 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[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
1 - \frac{\frac{x}{y - z}}{y - t}

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. Simplified1.2

    \[\leadsto \color{blue}{1 - \frac{\frac{x}{y - z}}{y - t}} \]
    Proof

    [Start]0.6

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

    associate-/r* [=>]1.2

    \[ 1 - \color{blue}{\frac{\frac{x}{y - z}}{y - t}} \]
  3. Final simplification1.2

    \[\leadsto 1 - \frac{\frac{x}{y - z}}{y - t} \]

Alternatives

Alternative 1
Error4.4
Cost968
\[\begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{-27}:\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-111}:\\ \;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + x \cdot \frac{\frac{1}{t}}{y - z}\\ \end{array} \]
Alternative 2
Error9.0
Cost841
\[\begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-117} \lor \neg \left(y \leq 1.8 \cdot 10^{-41}\right):\\ \;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{z}}{t}\\ \end{array} \]
Alternative 3
Error5.3
Cost840
\[\begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{-140}:\\ \;\;\;\;1 - \frac{\frac{x}{z}}{t}\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-55}:\\ \;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\ \end{array} \]
Alternative 4
Error4.5
Cost840
\[\begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{-140}:\\ \;\;\;\;1 - \frac{\frac{x}{t - y}}{z}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-53}:\\ \;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\ \end{array} \]
Alternative 5
Error5.4
Cost840
\[\begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-27}:\\ \;\;\;\;1 - \frac{\frac{x}{t - y}}{z}\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-115}:\\ \;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\ \end{array} \]
Alternative 6
Error4.5
Cost840
\[\begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{-140}:\\ \;\;\;\;1 - \frac{\frac{x}{t - y}}{z}\\ \mathbf{elif}\;t \leq 1.82 \cdot 10^{-37}:\\ \;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\ \end{array} \]
Alternative 7
Error4.4
Cost840
\[\begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-27}:\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-108}:\\ \;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\ \end{array} \]
Alternative 8
Error12.0
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{-99} \lor \neg \left(y \leq 2.2 \cdot 10^{-39}\right):\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \end{array} \]
Alternative 9
Error12.2
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{-99} \lor \neg \left(y \leq 1.52 \cdot 10^{-38}\right):\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{z}}{t}\\ \end{array} \]
Alternative 10
Error0.6
Cost704
\[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
Alternative 11
Error25.3
Cost448
\[1 - \frac{x}{z \cdot t} \]

Error

Reproduce?

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