Average Error: 0.7 → 1.1
Time: 14.4s
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.7

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

    \[\leadsto \color{blue}{1 - \frac{\frac{x}{y - z}}{y - t}} \]
    Proof
    (-.f64 1 (/.f64 (/.f64 x (-.f64 y z)) (-.f64 y t))): 0 points increase in error, 0 points decrease in error
    (-.f64 1 (Rewrite<= associate-/r*_binary64 (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))))): 0 points increase in error, 0 points decrease in error
  3. Final simplification1.1

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

Alternatives

Alternative 1
Error10.0
Cost1368
\[\begin{array}{l} t_1 := 1 + \frac{\frac{x}{z}}{y}\\ t_2 := 1 - \frac{\frac{x}{y}}{y - t}\\ \mathbf{if}\;y \leq -2.2 \cdot 10^{-37}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-76}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-131}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-145}:\\ \;\;\;\;1 + \frac{\frac{-1}{t}}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq 5.3 \cdot 10^{-86}:\\ \;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-44}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error9.6
Cost1105
\[\begin{array}{l} t_1 := 1 - \frac{\frac{x}{y}}{y - t}\\ \mathbf{if}\;y \leq -8.5 \cdot 10^{-38}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-76}:\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y}\\ \mathbf{elif}\;y \leq -4.1 \cdot 10^{-132} \lor \neg \left(y \leq 3.5 \cdot 10^{-27}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{-1}{t}}{\frac{z}{x}}\\ \end{array} \]
Alternative 3
Error8.9
Cost841
\[\begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{-96} \lor \neg \left(y \leq 6.5 \cdot 10^{-139}\right):\\ \;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{-1}{t}}{\frac{z}{x}}\\ \end{array} \]
Alternative 4
Error10.7
Cost840
\[\begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{-119}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 28000000:\\ \;\;\;\;1 + \frac{\frac{-1}{t}}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \end{array} \]
Alternative 5
Error5.8
Cost836
\[\begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{-104}:\\ \;\;\;\;1 + x \cdot \frac{1}{z \cdot \left(y - t\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\ \end{array} \]
Alternative 6
Error12.9
Cost712
\[\begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{-239}:\\ \;\;\;\;1\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-136}:\\ \;\;\;\;1 + \frac{x}{y \cdot t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 7
Error10.1
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{-120}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-27}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 8
Error10.5
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{-120}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 5700000:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \end{array} \]
Alternative 9
Error10.7
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -7.5 \cdot 10^{-120}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 155000000:\\ \;\;\;\;1 - \frac{\frac{x}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \end{array} \]
Alternative 10
Error5.8
Cost708
\[\begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{-104}:\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\ \end{array} \]
Alternative 11
Error0.7
Cost704
\[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
Alternative 12
Error13.3
Cost64
\[1 \]

Error

Reproduce

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