
(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 12 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.6%
Final simplification98.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.2e-184) (not (<= z 1.7e-103))) (+ 1.0 (/ (/ x z) (- y t))) (+ 1.0 (/ (/ x t) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.2e-184) || !(z <= 1.7e-103)) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 + ((x / t) / 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 ((z <= (-3.2d-184)) .or. (.not. (z <= 1.7d-103))) then
tmp = 1.0d0 + ((x / z) / (y - t))
else
tmp = 1.0d0 + ((x / t) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.2e-184) || !(z <= 1.7e-103)) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.2e-184) or not (z <= 1.7e-103): tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 + ((x / t) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.2e-184) || !(z <= 1.7e-103)) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(1.0 + Float64(Float64(x / t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.2e-184) || ~((z <= 1.7e-103))) tmp = 1.0 + ((x / z) / (y - t)); else tmp = 1.0 + ((x / t) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.2e-184], N[Not[LessEqual[z, 1.7e-103]], $MachinePrecision]], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-184} \lor \neg \left(z \leq 1.7 \cdot 10^{-103}\right):\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -3.2e-184 or 1.70000000000000001e-103 < z Initial program 99.0%
sub-neg99.0%
neg-mul-199.0%
*-commutative99.0%
*-commutative99.0%
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 z around inf 91.6%
associate-/r*92.0%
Simplified92.0%
if -3.2e-184 < z < 1.70000000000000001e-103Initial program 97.5%
Taylor expanded in t around inf 83.4%
associate-*r/83.4%
neg-mul-183.4%
Simplified83.4%
Taylor expanded in y around inf 73.4%
mul-1-neg73.4%
associate-/r*74.9%
distribute-neg-frac74.9%
Simplified74.9%
Final simplification87.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.7e-78) (not (<= z 4.8e-102))) (+ 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.7e-78) || !(z <= 4.8e-102)) {
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.7d-78)) .or. (.not. (z <= 4.8d-102))) 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.7e-78) || !(z <= 4.8e-102)) {
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.7e-78) or not (z <= 4.8e-102): 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.7e-78) || !(z <= 4.8e-102)) 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 <= -1.7e-78) || ~((z <= 4.8e-102))) 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.7e-78], N[Not[LessEqual[z, 4.8e-102]], $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 -1.7 \cdot 10^{-78} \lor \neg \left(z \leq 4.8 \cdot 10^{-102}\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 < -1.70000000000000006e-78 or 4.8e-102 < z 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 z around inf 96.6%
associate-/r*96.6%
Simplified96.6%
if -1.70000000000000006e-78 < z < 4.8e-102Initial program 95.7%
Taylor expanded in z around 0 81.6%
Final simplification91.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.2e-78) (not (<= z 6.4e-103))) (+ 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 <= -2.2e-78) || !(z <= 6.4e-103)) {
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 <= (-2.2d-78)) .or. (.not. (z <= 6.4d-103))) 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 <= -2.2e-78) || !(z <= 6.4e-103)) {
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 <= -2.2e-78) or not (z <= 6.4e-103): 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 <= -2.2e-78) || !(z <= 6.4e-103)) 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 <= -2.2e-78) || ~((z <= 6.4e-103))) 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, -2.2e-78], N[Not[LessEqual[z, 6.4e-103]], $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 -2.2 \cdot 10^{-78} \lor \neg \left(z \leq 6.4 \cdot 10^{-103}\right):\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\
\end{array}
\end{array}
if z < -2.1999999999999999e-78 or 6.39999999999999953e-103 < z 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 z around inf 96.6%
associate-/r*96.6%
Simplified96.6%
if -2.1999999999999999e-78 < z < 6.39999999999999953e-103Initial program 95.7%
clear-num95.7%
inv-pow95.7%
*-commutative95.7%
associate-/l*88.5%
Applied egg-rr88.5%
unpow-188.5%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around 0 81.6%
associate-/r*77.8%
Simplified77.8%
Final simplification90.6%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.5e-206)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 1.3e-143)
(- 1.0 (/ x (* y (- y z))))
(+ 1.0 (/ x (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.5e-206) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.3e-143) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + (x / ((y - z) * 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 (t <= (-2.5d-206)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 1.3d-143) then
tmp = 1.0d0 - (x / (y * (y - z)))
else
tmp = 1.0d0 + (x / ((y - z) * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.5e-206) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.3e-143) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.5e-206: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 1.3e-143: tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.5e-206) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 1.3e-143) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.5e-206) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 1.3e-143) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.5e-206], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e-143], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-206}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-143}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -2.5e-206Initial program 97.9%
sub-neg97.9%
neg-mul-197.9%
*-commutative97.9%
*-commutative97.9%
associate-/r*95.2%
associate-*r/95.2%
metadata-eval95.2%
times-frac95.2%
*-lft-identity95.2%
neg-mul-195.2%
sub-neg95.2%
+-commutative95.2%
distribute-neg-out95.2%
remove-double-neg95.2%
sub-neg95.2%
Simplified95.2%
Taylor expanded in z around inf 74.7%
associate-/r*76.5%
Simplified76.5%
if -2.5e-206 < t < 1.29999999999999994e-143Initial program 97.8%
Taylor expanded in t around 0 95.6%
if 1.29999999999999994e-143 < t Initial program 99.9%
Taylor expanded in t around inf 95.1%
associate-*r/95.1%
neg-mul-195.1%
Simplified95.1%
Final simplification86.8%
(FPCore (x y z t)
:precision binary64
(if (<= t -3.7e-205)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 2.55e-61)
(- 1.0 (/ x (* y (- y z))))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.7e-205) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 2.55e-61) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
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 <= (-3.7d-205)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 2.55d-61) then
tmp = 1.0d0 - (x / (y * (y - z)))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.7e-205) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 2.55e-61) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.7e-205: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 2.55e-61: tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.7e-205) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 2.55e-61) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.7e-205) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 2.55e-61) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.7e-205], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-61], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{-205}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-61}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -3.7000000000000001e-205Initial program 97.9%
sub-neg97.9%
neg-mul-197.9%
*-commutative97.9%
*-commutative97.9%
associate-/r*95.2%
associate-*r/95.2%
metadata-eval95.2%
times-frac95.2%
*-lft-identity95.2%
neg-mul-195.2%
sub-neg95.2%
+-commutative95.2%
distribute-neg-out95.2%
remove-double-neg95.2%
sub-neg95.2%
Simplified95.2%
Taylor expanded in z around inf 74.7%
associate-/r*76.5%
Simplified76.5%
if -3.7000000000000001e-205 < t < 2.54999999999999984e-61Initial program 98.3%
Taylor expanded in t around 0 94.5%
if 2.54999999999999984e-61 < t Initial program 99.8%
Taylor expanded in t around inf 96.7%
associate-*r/96.7%
neg-mul-196.7%
Simplified96.7%
Taylor expanded in x around 0 96.7%
mul-1-neg96.7%
associate-/r*96.8%
distribute-neg-frac96.8%
Simplified96.8%
Final simplification87.1%
(FPCore (x y z t) :precision binary64 (if (<= t -9.8e-129) 1.0 (if (<= t 4.1e-221) (+ 1.0 (/ x (* y z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -9.8e-129) {
tmp = 1.0;
} else if (t <= 4.1e-221) {
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 <= (-9.8d-129)) then
tmp = 1.0d0
else if (t <= 4.1d-221) 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 <= -9.8e-129) {
tmp = 1.0;
} else if (t <= 4.1e-221) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -9.8e-129: tmp = 1.0 elif t <= 4.1e-221: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -9.8e-129) tmp = 1.0; elseif (t <= 4.1e-221) 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 <= -9.8e-129) tmp = 1.0; elseif (t <= 4.1e-221) tmp = 1.0 + (x / (y * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -9.8e-129], 1.0, If[LessEqual[t, 4.1e-221], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.8 \cdot 10^{-129}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{-221}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -9.80000000000000004e-129 or 4.09999999999999981e-221 < t Initial program 99.2%
Taylor expanded in z around 0 68.8%
Taylor expanded in x around 0 76.9%
if -9.80000000000000004e-129 < t < 4.09999999999999981e-221Initial program 95.9%
sub-neg95.9%
neg-mul-195.9%
*-commutative95.9%
*-commutative95.9%
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 z around inf 82.0%
associate-/r*86.0%
Simplified86.0%
Taylor expanded in y around inf 77.8%
*-commutative77.8%
Simplified77.8%
Final simplification77.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.35e-170) 1.0 (if (<= z 3.05e-109) (+ 1.0 (/ x (* y t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e-170) {
tmp = 1.0;
} else if (z <= 3.05e-109) {
tmp = 1.0 + (x / (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 (z <= (-1.35d-170)) then
tmp = 1.0d0
else if (z <= 3.05d-109) then
tmp = 1.0d0 + (x / (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 (z <= -1.35e-170) {
tmp = 1.0;
} else if (z <= 3.05e-109) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.35e-170: tmp = 1.0 elif z <= 3.05e-109: tmp = 1.0 + (x / (y * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.35e-170) tmp = 1.0; elseif (z <= 3.05e-109) tmp = Float64(1.0 + Float64(x / Float64(y * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.35e-170) tmp = 1.0; elseif (z <= 3.05e-109) tmp = 1.0 + (x / (y * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.35e-170], 1.0, If[LessEqual[z, 3.05e-109], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-170}:\\
\;\;\;\;1\\
\mathbf{elif}\;z \leq 3.05 \cdot 10^{-109}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -1.3499999999999999e-170 or 3.0499999999999998e-109 < z Initial program 99.4%
Taylor expanded in z around 0 62.4%
Taylor expanded in x around 0 79.5%
if -1.3499999999999999e-170 < z < 3.0499999999999998e-109Initial program 96.2%
Taylor expanded in z around 0 86.6%
Taylor expanded in t around inf 71.8%
+-commutative71.8%
Simplified71.8%
Final simplification77.6%
(FPCore (x y z t) :precision binary64 (if (<= y -1.76e-99) 1.0 (if (<= y 3.9e-56) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.76e-99) {
tmp = 1.0;
} else if (y <= 3.9e-56) {
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 <= (-1.76d-99)) then
tmp = 1.0d0
else if (y <= 3.9d-56) 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 <= -1.76e-99) {
tmp = 1.0;
} else if (y <= 3.9e-56) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.76e-99: tmp = 1.0 elif y <= 3.9e-56: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.76e-99) tmp = 1.0; elseif (y <= 3.9e-56) 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 <= -1.76e-99) tmp = 1.0; elseif (y <= 3.9e-56) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.76e-99], 1.0, If[LessEqual[y, 3.9e-56], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.76 \cdot 10^{-99}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-56}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.75999999999999991e-99 or 3.9e-56 < y Initial program 100.0%
Taylor expanded in z around 0 89.8%
Taylor expanded in x around 0 89.5%
if -1.75999999999999991e-99 < y < 3.9e-56Initial program 96.4%
Taylor expanded in y around 0 74.3%
Final simplification83.7%
(FPCore (x y z t) :precision binary64 (if (<= y -4.5e-99) 1.0 (if (<= y 4.7e-57) (- 1.0 (/ (/ x t) z)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.5e-99) {
tmp = 1.0;
} else if (y <= 4.7e-57) {
tmp = 1.0 - ((x / t) / 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 (y <= (-4.5d-99)) then
tmp = 1.0d0
else if (y <= 4.7d-57) then
tmp = 1.0d0 - ((x / t) / 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 (y <= -4.5e-99) {
tmp = 1.0;
} else if (y <= 4.7e-57) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.5e-99: tmp = 1.0 elif y <= 4.7e-57: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.5e-99) tmp = 1.0; elseif (y <= 4.7e-57) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.5e-99) tmp = 1.0; elseif (y <= 4.7e-57) tmp = 1.0 - ((x / t) / z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.5e-99], 1.0, If[LessEqual[y, 4.7e-57], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-99}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{-57}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -4.5000000000000003e-99 or 4.6999999999999998e-57 < y Initial program 100.0%
Taylor expanded in z around 0 89.8%
Taylor expanded in x around 0 89.5%
if -4.5000000000000003e-99 < y < 4.6999999999999998e-57Initial program 96.4%
Taylor expanded in t around inf 83.7%
associate-*r/83.7%
neg-mul-183.7%
Simplified83.7%
Taylor expanded in y around 0 74.3%
associate-/r*75.8%
Simplified75.8%
Final simplification84.3%
(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.6%
sub-neg98.6%
neg-mul-198.6%
*-commutative98.6%
*-commutative98.6%
associate-/r*96.3%
associate-*r/96.3%
metadata-eval96.3%
times-frac96.3%
*-lft-identity96.3%
neg-mul-196.3%
sub-neg96.3%
+-commutative96.3%
distribute-neg-out96.3%
remove-double-neg96.3%
sub-neg96.3%
Simplified96.3%
Final simplification96.3%
(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.6%
Taylor expanded in z around 0 68.5%
Taylor expanded in x around 0 74.4%
Final simplification74.4%
herbie shell --seed 2024096
(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)))))