
(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 9 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.5%
Final simplification98.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8.5e-124) (not (<= z 4.5e-75))) (+ 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 <= -8.5e-124) || !(z <= 4.5e-75)) {
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 <= (-8.5d-124)) .or. (.not. (z <= 4.5d-75))) 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 <= -8.5e-124) || !(z <= 4.5e-75)) {
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 <= -8.5e-124) or not (z <= 4.5e-75): 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 <= -8.5e-124) || !(z <= 4.5e-75)) 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 <= -8.5e-124) || ~((z <= 4.5e-75))) 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, -8.5e-124], N[Not[LessEqual[z, 4.5e-75]], $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 -8.5 \cdot 10^{-124} \lor \neg \left(z \leq 4.5 \cdot 10^{-75}\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 < -8.5000000000000002e-124 or 4.5000000000000003e-75 < z Initial program 99.5%
sub-neg99.5%
neg-mul-199.5%
*-commutative99.5%
*-commutative99.5%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
times-frac99.4%
*-lft-identity99.4%
neg-mul-199.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-out99.4%
remove-double-neg99.4%
sub-neg99.4%
Simplified99.4%
Taylor expanded in z around inf 93.9%
associate-/r*94.2%
Simplified94.2%
if -8.5000000000000002e-124 < z < 4.5000000000000003e-75Initial program 96.4%
Taylor expanded in z around 0 87.0%
Final simplification91.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.05e-126) (not (<= z 5.5e-75))) (+ 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 <= -1.05e-126) || !(z <= 5.5e-75)) {
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 <= (-1.05d-126)) .or. (.not. (z <= 5.5d-75))) 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 <= -1.05e-126) || !(z <= 5.5e-75)) {
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 <= -1.05e-126) or not (z <= 5.5e-75): 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 <= -1.05e-126) || !(z <= 5.5e-75)) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.05e-126) || ~((z <= 5.5e-75))) 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, -1.05e-126], N[Not[LessEqual[z, 5.5e-75]], $MachinePrecision]], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-126} \lor \neg \left(z \leq 5.5 \cdot 10^{-75}\right):\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\
\end{array}
\end{array}
if z < -1.0499999999999999e-126 or 5.50000000000000026e-75 < z Initial program 99.5%
sub-neg99.5%
neg-mul-199.5%
*-commutative99.5%
*-commutative99.5%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
times-frac99.4%
*-lft-identity99.4%
neg-mul-199.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-out99.4%
remove-double-neg99.4%
sub-neg99.4%
Simplified99.4%
Taylor expanded in z around inf 94.0%
associate-/r*94.2%
Simplified94.2%
if -1.0499999999999999e-126 < z < 5.50000000000000026e-75Initial program 96.3%
Taylor expanded in z around 0 88.0%
expm1-log1p-u72.4%
expm1-udef72.4%
Applied egg-rr72.4%
expm1-def72.4%
expm1-log1p88.0%
associate-/r*89.3%
Simplified89.3%
Final simplification92.7%
(FPCore (x y z t) :precision binary64 (if (<= y -3e-66) (+ 1.0 (/ (/ x y) (- z y))) (if (<= y 1.5e-31) (+ 1.0 (/ (/ x z) (- y t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3e-66) {
tmp = 1.0 + ((x / y) / (z - y));
} else if (y <= 1.5e-31) {
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 <= (-3d-66)) then
tmp = 1.0d0 + ((x / y) / (z - y))
else if (y <= 1.5d-31) 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 <= -3e-66) {
tmp = 1.0 + ((x / y) / (z - y));
} else if (y <= 1.5e-31) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3e-66: tmp = 1.0 + ((x / y) / (z - y)) elif y <= 1.5e-31: tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3e-66) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); elseif (y <= 1.5e-31) 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 <= -3e-66) tmp = 1.0 + ((x / y) / (z - y)); elseif (y <= 1.5e-31) tmp = 1.0 + ((x / z) / (y - t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3e-66], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-31], 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 -3 \cdot 10^{-66}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-31}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.0000000000000002e-66Initial program 100.0%
sub-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
*-commutative100.0%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
*-lft-identity100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
clear-num100.0%
inv-pow100.0%
div-inv100.0%
clear-num99.9%
Applied egg-rr99.9%
unpow-199.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in t around 0 94.3%
associate-/r*94.4%
Simplified94.4%
if -3.0000000000000002e-66 < y < 1.49999999999999991e-31Initial program 96.4%
sub-neg96.4%
neg-mul-196.4%
*-commutative96.4%
*-commutative96.4%
associate-/r*96.2%
associate-*r/96.2%
metadata-eval96.2%
times-frac96.2%
*-lft-identity96.2%
neg-mul-196.2%
sub-neg96.2%
+-commutative96.2%
distribute-neg-out96.2%
remove-double-neg96.2%
sub-neg96.2%
Simplified96.2%
Taylor expanded in z around inf 86.6%
associate-/r*86.3%
Simplified86.3%
if 1.49999999999999991e-31 < y Initial program 100.0%
sub-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
*-commutative100.0%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
*-lft-identity100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 78.7%
associate-*r/78.7%
neg-mul-178.7%
associate-/r*78.6%
Simplified78.6%
Taylor expanded in x around 0 95.4%
Final simplification91.4%
(FPCore (x y z t)
:precision binary64
(if (<= t -5.2e-205)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 850000.0)
(+ 1.0 (/ (/ x y) (- z y)))
(- 1.0 (/ (/ x t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.2e-205) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 850000.0) {
tmp = 1.0 + ((x / y) / (z - y));
} 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 <= (-5.2d-205)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 850000.0d0) then
tmp = 1.0d0 + ((x / y) / (z - y))
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 <= -5.2e-205) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 850000.0) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.2e-205: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 850000.0: tmp = 1.0 + ((x / y) / (z - y)) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.2e-205) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 850000.0) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); 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 <= -5.2e-205) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 850000.0) tmp = 1.0 + ((x / y) / (z - y)); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.2e-205], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 850000.0], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $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 -5.2 \cdot 10^{-205}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 850000:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if t < -5.1999999999999997e-205Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*99.0%
associate-*r/99.0%
metadata-eval99.0%
times-frac99.0%
*-lft-identity99.0%
neg-mul-199.0%
sub-neg99.0%
+-commutative99.0%
distribute-neg-out99.0%
remove-double-neg99.0%
sub-neg99.0%
Simplified99.0%
Taylor expanded in z around inf 85.1%
associate-/r*84.9%
Simplified84.9%
if -5.1999999999999997e-205 < t < 8.5e5Initial program 95.4%
sub-neg95.4%
neg-mul-195.4%
*-commutative95.4%
*-commutative95.4%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
*-lft-identity99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
clear-num99.9%
inv-pow99.9%
div-inv99.8%
clear-num99.9%
Applied egg-rr99.9%
unpow-199.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in t around 0 84.8%
associate-/r*88.3%
Simplified88.3%
if 8.5e5 < t Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*96.1%
associate-*r/96.1%
metadata-eval96.1%
times-frac96.1%
*-lft-identity96.1%
neg-mul-196.1%
sub-neg96.1%
+-commutative96.1%
distribute-neg-out96.1%
remove-double-neg96.1%
sub-neg96.1%
Simplified96.1%
Taylor expanded in t around inf 99.9%
associate-*r/99.9%
neg-mul-199.9%
associate-/r*100.0%
Simplified100.0%
Final simplification90.2%
(FPCore (x y z t) :precision binary64 (if (<= y -2.4e-70) 1.0 (if (<= y 4.2e-62) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e-70) {
tmp = 1.0;
} else if (y <= 4.2e-62) {
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.4d-70)) then
tmp = 1.0d0
else if (y <= 4.2d-62) 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.4e-70) {
tmp = 1.0;
} else if (y <= 4.2e-62) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.4e-70: tmp = 1.0 elif y <= 4.2e-62: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.4e-70) tmp = 1.0; elseif (y <= 4.2e-62) 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.4e-70) tmp = 1.0; elseif (y <= 4.2e-62) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.4e-70], 1.0, If[LessEqual[y, 4.2e-62], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-70}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-62}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.4000000000000001e-70 or 4.1999999999999998e-62 < y Initial program 100.0%
sub-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
*-commutative100.0%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
*-lft-identity100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 76.9%
associate-*r/76.9%
neg-mul-176.9%
associate-/r*76.9%
Simplified76.9%
Taylor expanded in x around 0 91.3%
if -2.4000000000000001e-70 < y < 4.1999999999999998e-62Initial program 96.0%
Taylor expanded in y around 0 75.4%
Final simplification85.5%
(FPCore (x y z t) :precision binary64 (if (<= y -2.15e-120) (+ 1.0 (/ (/ x y) (- z y))) (if (<= y 1.7e-66) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.15e-120) {
tmp = 1.0 + ((x / y) / (z - y));
} else if (y <= 1.7e-66) {
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.15d-120)) then
tmp = 1.0d0 + ((x / y) / (z - y))
else if (y <= 1.7d-66) 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.15e-120) {
tmp = 1.0 + ((x / y) / (z - y));
} else if (y <= 1.7e-66) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.15e-120: tmp = 1.0 + ((x / y) / (z - y)) elif y <= 1.7e-66: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.15e-120) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); elseif (y <= 1.7e-66) 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.15e-120) tmp = 1.0 + ((x / y) / (z - y)); elseif (y <= 1.7e-66) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.15e-120], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-66], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{-120}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-66}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.14999999999999991e-120Initial program 100.0%
sub-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
*-commutative100.0%
associate-/r*99.0%
associate-*r/99.0%
metadata-eval99.0%
times-frac99.0%
*-lft-identity99.0%
neg-mul-199.0%
sub-neg99.0%
+-commutative99.0%
distribute-neg-out99.0%
remove-double-neg99.0%
sub-neg99.0%
Simplified99.0%
clear-num99.0%
inv-pow99.0%
div-inv99.0%
clear-num99.0%
Applied egg-rr99.0%
unpow-199.0%
associate-/r*99.0%
Simplified99.0%
Taylor expanded in t around 0 91.5%
associate-/r*91.5%
Simplified91.5%
if -2.14999999999999991e-120 < y < 1.69999999999999999e-66Initial program 95.5%
Taylor expanded in y around 0 76.7%
if 1.69999999999999999e-66 < y Initial program 100.0%
sub-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
*-commutative100.0%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
*-lft-identity99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 79.6%
associate-*r/79.6%
neg-mul-179.6%
associate-/r*79.6%
Simplified79.6%
Taylor expanded in x around 0 94.2%
Final simplification87.5%
(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.5%
sub-neg98.5%
neg-mul-198.5%
*-commutative98.5%
*-commutative98.5%
associate-/r*98.5%
associate-*r/98.5%
metadata-eval98.5%
times-frac98.5%
*-lft-identity98.5%
neg-mul-198.5%
sub-neg98.5%
+-commutative98.5%
distribute-neg-out98.5%
remove-double-neg98.5%
sub-neg98.5%
Simplified98.5%
Final simplification98.5%
(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.5%
sub-neg98.5%
neg-mul-198.5%
*-commutative98.5%
*-commutative98.5%
associate-/r*98.5%
associate-*r/98.5%
metadata-eval98.5%
times-frac98.5%
*-lft-identity98.5%
neg-mul-198.5%
sub-neg98.5%
+-commutative98.5%
distribute-neg-out98.5%
remove-double-neg98.5%
sub-neg98.5%
Simplified98.5%
Taylor expanded in t around inf 78.4%
associate-*r/78.4%
neg-mul-178.4%
associate-/r*78.7%
Simplified78.7%
Taylor expanded in x around 0 75.5%
Final simplification75.5%
herbie shell --seed 2024018
(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)))))