
(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)));
}
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)));
}
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 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]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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)));
}
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)));
}
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 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]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
(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)));
}
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)));
}
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 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]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Initial program 98.8%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.6e-98) (not (<= z 2.5e-97))) (+ 1.0 (/ (/ x z) (- y t))) (- 1.0 (/ x (* y (- y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.6e-98) || !(z <= 2.5e-97)) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 - (x / (y * (y - t)));
}
return tmp;
}
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
real(8) :: tmp
if ((z <= (-5.6d-98)) .or. (.not. (z <= 2.5d-97))) then
tmp = 1.0d0 + ((x / z) / (y - t))
else
tmp = 1.0d0 - (x / (y * (y - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.6e-98) || !(z <= 2.5e-97)) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 - (x / (y * (y - t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.6e-98) or not (z <= 2.5e-97): tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 - (x / (y * (y - t))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.6e-98) || !(z <= 2.5e-97)) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.6e-98) || ~((z <= 2.5e-97))) tmp = 1.0 + ((x / z) / (y - t)); else tmp = 1.0 - (x / (y * (y - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.6e-98], N[Not[LessEqual[z, 2.5e-97]], $MachinePrecision]], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{-98} \lor \neg \left(z \leq 2.5 \cdot 10^{-97}\right):\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if z < -5.5999999999999998e-98 or 2.4999999999999998e-97 < z Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
times-frac99.4%
neg-mul-199.4%
remove-double-neg99.4%
neg-mul-199.4%
sub-neg99.4%
distribute-neg-out99.4%
remove-double-neg99.4%
+-commutative99.4%
sub-neg99.4%
Simplified99.4%
Taylor expanded in z around inf 96.9%
+-commutative96.9%
associate-/r*96.4%
Simplified96.4%
if -5.5999999999999998e-98 < z < 2.4999999999999998e-97Initial program 96.7%
sub-neg96.7%
distribute-frac-neg96.7%
*-lft-identity96.7%
associate-/r*96.6%
associate-*r/96.6%
metadata-eval96.6%
times-frac96.6%
neg-mul-196.6%
remove-double-neg96.6%
neg-mul-196.6%
sub-neg96.6%
distribute-neg-out96.6%
remove-double-neg96.6%
+-commutative96.6%
sub-neg96.6%
Simplified96.6%
Taylor expanded in z around 0 85.5%
mul-1-neg85.5%
sub-neg85.5%
Simplified85.5%
Final simplification92.7%
(FPCore (x y z t) :precision binary64 (if (<= y -1.02e-37) 1.0 (if (<= y 7.5e-128) (+ 1.0 (/ (/ x z) (- y t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.02e-37) {
tmp = 1.0;
} else if (y <= 7.5e-128) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0;
}
return tmp;
}
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
real(8) :: tmp
if (y <= (-1.02d-37)) then
tmp = 1.0d0
else if (y <= 7.5d-128) then
tmp = 1.0d0 + ((x / z) / (y - t))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.02e-37) {
tmp = 1.0;
} else if (y <= 7.5e-128) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.02e-37: tmp = 1.0 elif y <= 7.5e-128: tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.02e-37) tmp = 1.0; elseif (y <= 7.5e-128) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.02e-37) tmp = 1.0; elseif (y <= 7.5e-128) tmp = 1.0 + ((x / z) / (y - t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.02e-37], 1.0, If[LessEqual[y, 7.5e-128], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-37}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-128}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.02000000000000006e-37 or 7.50000000000000021e-128 < y Initial program 100.0%
sub-neg100.0%
distribute-frac-neg100.0%
*-lft-identity100.0%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub-neg99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 89.4%
if -1.02000000000000006e-37 < y < 7.50000000000000021e-128Initial program 97.0%
sub-neg97.0%
distribute-frac-neg97.0%
*-lft-identity97.0%
associate-/r*96.1%
associate-*r/96.1%
metadata-eval96.1%
times-frac96.1%
neg-mul-196.1%
remove-double-neg96.1%
neg-mul-196.1%
sub-neg96.1%
distribute-neg-out96.1%
remove-double-neg96.1%
+-commutative96.1%
sub-neg96.1%
Simplified96.1%
Taylor expanded in z around inf 87.4%
+-commutative87.4%
associate-/r*86.5%
Simplified86.5%
Final simplification88.3%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.3e-178)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 5.5e-64)
(- 1.0 (/ x (* y (- y z))))
(- 1.0 (/ (/ x t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.3e-178) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 5.5e-64) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
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
real(8) :: tmp
if (t <= (-1.3d-178)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 5.5d-64) then
tmp = 1.0d0 - (x / (y * (y - z)))
else
tmp = 1.0d0 - ((x / t) / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.3e-178) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 5.5e-64) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.3e-178: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 5.5e-64: tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.3e-178) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 5.5e-64) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); else tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.3e-178) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 5.5e-64) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.3e-178], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-64], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-178}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-64}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if t < -1.29999999999999999e-178Initial program 99.0%
sub-neg99.0%
distribute-frac-neg99.0%
*-lft-identity99.0%
associate-/r*99.0%
associate-*r/99.0%
metadata-eval99.0%
times-frac99.0%
neg-mul-199.0%
remove-double-neg99.0%
neg-mul-199.0%
sub-neg99.0%
distribute-neg-out99.0%
remove-double-neg99.0%
+-commutative99.0%
sub-neg99.0%
Simplified99.0%
Taylor expanded in z around inf 81.8%
+-commutative81.8%
associate-/r*80.8%
Simplified80.8%
if -1.29999999999999999e-178 < t < 5.4999999999999999e-64Initial program 97.4%
Taylor expanded in t around 0 94.2%
if 5.4999999999999999e-64 < t Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*96.5%
associate-*r/96.5%
metadata-eval96.5%
times-frac96.5%
neg-mul-196.5%
remove-double-neg96.5%
neg-mul-196.5%
sub-neg96.5%
distribute-neg-out96.5%
remove-double-neg96.5%
+-commutative96.5%
sub-neg96.5%
Simplified96.5%
Taylor expanded in t around inf 97.5%
mul-1-neg97.5%
unsub-neg97.5%
associate-/r*96.4%
Simplified96.4%
Final simplification89.7%
(FPCore (x y z t) :precision binary64 (if (<= t -2.4e-178) (+ 1.0 (/ (/ x z) (- y t))) (if (<= t 1e-62) (- 1.0 (/ (/ x y) (- y z))) (- 1.0 (/ (/ x t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.4e-178) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1e-62) {
tmp = 1.0 - ((x / y) / (y - z));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
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
real(8) :: tmp
if (t <= (-2.4d-178)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 1d-62) then
tmp = 1.0d0 - ((x / y) / (y - z))
else
tmp = 1.0d0 - ((x / t) / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.4e-178) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1e-62) {
tmp = 1.0 - ((x / y) / (y - z));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.4e-178: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 1e-62: tmp = 1.0 - ((x / y) / (y - z)) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.4e-178) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 1e-62) tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - z))); else tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.4e-178) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 1e-62) tmp = 1.0 - ((x / y) / (y - z)); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.4e-178], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-62], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-178}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 10^{-62}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if t < -2.40000000000000005e-178Initial program 99.0%
sub-neg99.0%
distribute-frac-neg99.0%
*-lft-identity99.0%
associate-/r*99.0%
associate-*r/99.0%
metadata-eval99.0%
times-frac99.0%
neg-mul-199.0%
remove-double-neg99.0%
neg-mul-199.0%
sub-neg99.0%
distribute-neg-out99.0%
remove-double-neg99.0%
+-commutative99.0%
sub-neg99.0%
Simplified99.0%
Taylor expanded in z around inf 81.8%
+-commutative81.8%
associate-/r*80.8%
Simplified80.8%
if -2.40000000000000005e-178 < t < 1e-62Initial program 97.4%
clear-num97.4%
associate-/r/97.4%
*-commutative97.4%
Applied egg-rr97.4%
Taylor expanded in t around 0 94.2%
associate-/r*95.3%
Simplified95.3%
if 1e-62 < t Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*96.5%
associate-*r/96.5%
metadata-eval96.5%
times-frac96.5%
neg-mul-196.5%
remove-double-neg96.5%
neg-mul-196.5%
sub-neg96.5%
distribute-neg-out96.5%
remove-double-neg96.5%
+-commutative96.5%
sub-neg96.5%
Simplified96.5%
Taylor expanded in t around inf 97.5%
mul-1-neg97.5%
unsub-neg97.5%
associate-/r*96.4%
Simplified96.4%
Final simplification90.0%
(FPCore (x y z t) :precision binary64 (if (<= y -2.16e-38) 1.0 (if (<= y 1.9e-125) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.16e-38) {
tmp = 1.0;
} else if (y <= 1.9e-125) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
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
real(8) :: tmp
if (y <= (-2.16d-38)) then
tmp = 1.0d0
else if (y <= 1.9d-125) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.16e-38) {
tmp = 1.0;
} else if (y <= 1.9e-125) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.16e-38: tmp = 1.0 elif y <= 1.9e-125: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.16e-38) tmp = 1.0; elseif (y <= 1.9e-125) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.16e-38) tmp = 1.0; elseif (y <= 1.9e-125) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.16e-38], 1.0, If[LessEqual[y, 1.9e-125], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.16 \cdot 10^{-38}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-125}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.16e-38 or 1.9000000000000001e-125 < y Initial program 100.0%
sub-neg100.0%
distribute-frac-neg100.0%
*-lft-identity100.0%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub-neg99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 89.4%
if -2.16e-38 < y < 1.9000000000000001e-125Initial program 97.0%
sub-neg97.0%
distribute-frac-neg97.0%
*-lft-identity97.0%
associate-/r*96.1%
associate-*r/96.1%
metadata-eval96.1%
times-frac96.1%
neg-mul-196.1%
remove-double-neg96.1%
neg-mul-196.1%
sub-neg96.1%
distribute-neg-out96.1%
remove-double-neg96.1%
+-commutative96.1%
sub-neg96.1%
Simplified96.1%
Taylor expanded in y around 0 76.4%
mul-1-neg76.4%
sub-neg76.4%
Simplified76.4%
Final simplification84.4%
(FPCore (x y z t) :precision binary64 (+ 1.0 (/ (/ x (- z y)) (- y t))))
double code(double x, double y, double z, double t) {
return 1.0 + ((x / (z - y)) / (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 / (z - y)) / (y - t))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + ((x / (z - y)) / (y - t));
}
def code(x, y, z, t): return 1.0 + ((x / (z - y)) / (y - t))
function code(x, y, z, t) return Float64(1.0 + Float64(Float64(x / Float64(z - y)) / Float64(y - t))) end
function tmp = code(x, y, z, t) tmp = 1.0 + ((x / (z - y)) / (y - t)); end
code[x_, y_, z_, t_] := N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{\frac{x}{z - y}}{y - t}
\end{array}
Initial program 98.8%
sub-neg98.8%
distribute-frac-neg98.8%
*-lft-identity98.8%
associate-/r*98.4%
associate-*r/98.4%
metadata-eval98.4%
times-frac98.4%
neg-mul-198.4%
remove-double-neg98.4%
neg-mul-198.4%
sub-neg98.4%
distribute-neg-out98.4%
remove-double-neg98.4%
+-commutative98.4%
sub-neg98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (if (<= t 2.3e-224) (+ 1.0 (/ x (* y z))) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.3e-224) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
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
real(8) :: tmp
if (t <= 2.3d-224) then
tmp = 1.0d0 + (x / (y * z))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.3e-224) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2.3e-224: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2.3e-224) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 2.3e-224) tmp = 1.0 + (x / (y * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2.3e-224], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.3 \cdot 10^{-224}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < 2.29999999999999988e-224Initial program 98.0%
sub-neg98.0%
distribute-frac-neg98.0%
*-lft-identity98.0%
associate-/r*99.3%
associate-*r/99.3%
metadata-eval99.3%
times-frac99.3%
neg-mul-199.3%
remove-double-neg99.3%
neg-mul-199.3%
sub-neg99.3%
distribute-neg-out99.3%
remove-double-neg99.3%
+-commutative99.3%
sub-neg99.3%
Simplified99.3%
Taylor expanded in z around inf 82.2%
+-commutative82.2%
associate-/r*82.8%
Simplified82.8%
Taylor expanded in y around inf 66.8%
if 2.29999999999999988e-224 < t Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*97.4%
associate-*r/97.4%
metadata-eval97.4%
times-frac97.4%
neg-mul-197.4%
remove-double-neg97.4%
neg-mul-197.4%
sub-neg97.4%
distribute-neg-out97.4%
remove-double-neg97.4%
+-commutative97.4%
sub-neg97.4%
Simplified97.4%
Taylor expanded in x around 0 79.4%
Final simplification72.3%
(FPCore (x y z t) :precision binary64 (if (<= t 8.2e-224) (+ 1.0 (/ (/ x z) y)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8.2e-224) {
tmp = 1.0 + ((x / z) / y);
} else {
tmp = 1.0;
}
return tmp;
}
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
real(8) :: tmp
if (t <= 8.2d-224) then
tmp = 1.0d0 + ((x / z) / y)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8.2e-224) {
tmp = 1.0 + ((x / z) / y);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 8.2e-224: tmp = 1.0 + ((x / z) / y) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 8.2e-224) tmp = Float64(1.0 + Float64(Float64(x / z) / y)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 8.2e-224) tmp = 1.0 + ((x / z) / y); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 8.2e-224], N[(1.0 + N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8.2 \cdot 10^{-224}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < 8.19999999999999972e-224Initial program 98.0%
sub-neg98.0%
distribute-frac-neg98.0%
*-lft-identity98.0%
associate-/r*99.3%
associate-*r/99.3%
metadata-eval99.3%
times-frac99.3%
neg-mul-199.3%
remove-double-neg99.3%
neg-mul-199.3%
sub-neg99.3%
distribute-neg-out99.3%
remove-double-neg99.3%
+-commutative99.3%
sub-neg99.3%
Simplified99.3%
Taylor expanded in z around inf 82.2%
+-commutative82.2%
associate-/r*82.8%
Simplified82.8%
Taylor expanded in y around inf 66.8%
*-commutative66.8%
associate-/r*68.0%
Simplified68.0%
if 8.19999999999999972e-224 < t Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*97.4%
associate-*r/97.4%
metadata-eval97.4%
times-frac97.4%
neg-mul-197.4%
remove-double-neg97.4%
neg-mul-197.4%
sub-neg97.4%
distribute-neg-out97.4%
remove-double-neg97.4%
+-commutative97.4%
sub-neg97.4%
Simplified97.4%
Taylor expanded in x around 0 79.4%
Final simplification73.0%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
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
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 98.8%
sub-neg98.8%
distribute-frac-neg98.8%
*-lft-identity98.8%
associate-/r*98.4%
associate-*r/98.4%
metadata-eval98.4%
times-frac98.4%
neg-mul-198.4%
remove-double-neg98.4%
neg-mul-198.4%
sub-neg98.4%
distribute-neg-out98.4%
remove-double-neg98.4%
+-commutative98.4%
sub-neg98.4%
Simplified98.4%
Taylor expanded in x around 0 74.0%
Final simplification74.0%
herbie shell --seed 2024013
(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)))))