
(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 t) (- z y)))))
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - t) * (z - y)));
}
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 - t) * (z - y)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - t) * (z - y)));
}
def code(x, y, z, t): return 1.0 + (x / ((y - t) * (z - y)))
function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - t) * Float64(z - y)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (x / ((y - t) * (z - y))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{\left(y - t\right) \cdot \left(z - y\right)}
\end{array}
Initial program 98.8%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.95e-51)
(- 1.0 (/ x (* z t)))
(if (<= t 9e-288)
(+ 1.0 (/ x (* y z)))
(if (<= t 1.9e-165) (- 1.0 (/ (/ x y) y)) (- 1.0 (/ (/ x t) (- z y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.95e-51) {
tmp = 1.0 - (x / (z * t));
} else if (t <= 9e-288) {
tmp = 1.0 + (x / (y * z));
} else if (t <= 1.9e-165) {
tmp = 1.0 - ((x / y) / 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 <= (-1.95d-51)) then
tmp = 1.0d0 - (x / (z * t))
else if (t <= 9d-288) then
tmp = 1.0d0 + (x / (y * z))
else if (t <= 1.9d-165) then
tmp = 1.0d0 - ((x / y) / 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 <= -1.95e-51) {
tmp = 1.0 - (x / (z * t));
} else if (t <= 9e-288) {
tmp = 1.0 + (x / (y * z));
} else if (t <= 1.9e-165) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.95e-51: tmp = 1.0 - (x / (z * t)) elif t <= 9e-288: tmp = 1.0 + (x / (y * z)) elif t <= 1.9e-165: tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.95e-51) tmp = Float64(1.0 - Float64(x / Float64(z * t))); elseif (t <= 9e-288) tmp = Float64(1.0 + Float64(x / Float64(y * z))); elseif (t <= 1.9e-165) tmp = Float64(1.0 - Float64(Float64(x / y) / 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 <= -1.95e-51) tmp = 1.0 - (x / (z * t)); elseif (t <= 9e-288) tmp = 1.0 + (x / (y * z)); elseif (t <= 1.9e-165) tmp = 1.0 - ((x / y) / y); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.95e-51], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e-288], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e-165], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $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.95 \cdot 10^{-51}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-288}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-165}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if t < -1.9499999999999999e-51Initial program 99.9%
Taylor expanded in y around 0 73.5%
if -1.9499999999999999e-51 < t < 9.0000000000000003e-288Initial program 98.3%
Taylor expanded in z around inf 81.6%
associate-/r*83.1%
Simplified83.1%
Taylor expanded in y around inf 76.0%
*-commutative76.0%
Simplified76.0%
if 9.0000000000000003e-288 < t < 1.90000000000000009e-165Initial program 95.3%
*-un-lft-identity95.3%
times-frac90.6%
Applied egg-rr90.6%
Taylor expanded in t around 0 77.2%
associate-/r*73.7%
Simplified73.7%
Taylor expanded in y around inf 59.2%
if 1.90000000000000009e-165 < t Initial program 99.0%
Taylor expanded in t around inf 88.9%
associate-/r*88.9%
Simplified88.9%
Final simplification79.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.3e-109) (not (<= y 2.1e-67))) (+ 1.0 (/ (/ x y) (- t y))) (- 1.0 (/ (/ x t) (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.3e-109) || !(y <= 2.1e-67)) {
tmp = 1.0 + ((x / y) / (t - 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 ((y <= (-1.3d-109)) .or. (.not. (y <= 2.1d-67))) then
tmp = 1.0d0 + ((x / y) / (t - 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 ((y <= -1.3e-109) || !(y <= 2.1e-67)) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.3e-109) or not (y <= 2.1e-67): tmp = 1.0 + ((x / y) / (t - y)) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.3e-109) || !(y <= 2.1e-67)) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - 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 ((y <= -1.3e-109) || ~((y <= 2.1e-67))) tmp = 1.0 + ((x / y) / (t - y)); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.3e-109], N[Not[LessEqual[y, 2.1e-67]], $MachinePrecision]], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - 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}\;y \leq -1.3 \cdot 10^{-109} \lor \neg \left(y \leq 2.1 \cdot 10^{-67}\right):\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if y < -1.2999999999999999e-109 or 2.1000000000000002e-67 < y Initial program 99.9%
Taylor expanded in z around 0 90.5%
sub-neg90.5%
associate-/r*90.6%
distribute-neg-frac290.6%
neg-sub090.6%
sub-neg90.6%
+-commutative90.6%
associate--r+90.6%
neg-sub090.6%
remove-double-neg90.6%
Simplified90.6%
if -1.2999999999999999e-109 < y < 2.1000000000000002e-67Initial program 96.8%
Taylor expanded in t around inf 87.4%
associate-/r*86.6%
Simplified86.6%
Final simplification89.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.55e-86)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= z 1.1e-251)
(+ 1.0 (/ (/ x y) (- t y)))
(- 1.0 (/ (/ x t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e-86) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 1.1e-251) {
tmp = 1.0 + ((x / y) / (t - 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 (z <= (-1.55d-86)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= 1.1d-251) then
tmp = 1.0d0 + ((x / y) / (t - 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 (z <= -1.55e-86) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 1.1e-251) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.55e-86: tmp = 1.0 + ((x / z) / (y - t)) elif z <= 1.1e-251: tmp = 1.0 + ((x / y) / (t - y)) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.55e-86) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 1.1e-251) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - 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 (z <= -1.55e-86) tmp = 1.0 + ((x / z) / (y - t)); elseif (z <= 1.1e-251) tmp = 1.0 + ((x / y) / (t - y)); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e-86], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-251], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - 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}\;z \leq -1.55 \cdot 10^{-86}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-251}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if z < -1.54999999999999994e-86Initial program 98.7%
Taylor expanded in z around inf 93.7%
associate-/r*94.9%
Simplified94.9%
if -1.54999999999999994e-86 < z < 1.1e-251Initial program 96.7%
Taylor expanded in z around 0 86.0%
sub-neg86.0%
associate-/r*86.1%
distribute-neg-frac286.1%
neg-sub086.1%
sub-neg86.1%
+-commutative86.1%
associate--r+86.1%
neg-sub086.1%
remove-double-neg86.1%
Simplified86.1%
if 1.1e-251 < z Initial program 99.9%
Taylor expanded in t around inf 79.2%
associate-/r*77.6%
Simplified77.6%
Final simplification84.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.9e-11) (not (<= y 1.15e-59))) (- 1.0 (/ (/ x y) y)) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.9e-11) || !(y <= 1.15e-59)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - (x / (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 ((y <= (-1.9d-11)) .or. (.not. (y <= 1.15d-59))) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 - (x / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.9e-11) || !(y <= 1.15e-59)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.9e-11) or not (y <= 1.15e-59): tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.9e-11) || !(y <= 1.15e-59)) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 - Float64(x / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.9e-11) || ~((y <= 1.15e-59))) tmp = 1.0 - ((x / y) / y); else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.9e-11], N[Not[LessEqual[y, 1.15e-59]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-11} \lor \neg \left(y \leq 1.15 \cdot 10^{-59}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -1.8999999999999999e-11 or 1.1499999999999999e-59 < y Initial program 99.9%
*-un-lft-identity99.9%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 95.6%
associate-/r*95.7%
Simplified95.7%
Taylor expanded in y around inf 88.8%
if -1.8999999999999999e-11 < y < 1.1499999999999999e-59Initial program 97.5%
Taylor expanded in y around 0 74.7%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (<= y -2.8e-64) 1.0 (if (<= y 3.6e-88) (- 1.0 (/ (/ x t) z)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e-64) {
tmp = 1.0;
} else if (y <= 3.6e-88) {
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 <= (-2.8d-64)) then
tmp = 1.0d0
else if (y <= 3.6d-88) 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 <= -2.8e-64) {
tmp = 1.0;
} else if (y <= 3.6e-88) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.8e-64: tmp = 1.0 elif y <= 3.6e-88: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.8e-64) tmp = 1.0; elseif (y <= 3.6e-88) 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 <= -2.8e-64) tmp = 1.0; elseif (y <= 3.6e-88) tmp = 1.0 - ((x / t) / z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.8e-64], 1.0, If[LessEqual[y, 3.6e-88], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-64}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-88}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.80000000000000004e-64 or 3.5999999999999999e-88 < y Initial program 99.9%
Taylor expanded in x around 0 84.8%
if -2.80000000000000004e-64 < y < 3.5999999999999999e-88Initial program 97.1%
*-un-lft-identity97.1%
times-frac95.5%
Applied egg-rr95.5%
Taylor expanded in y around 0 76.5%
associate-/r*74.8%
Simplified74.8%
(FPCore (x y z t) :precision binary64 (if (<= y -2.7e-64) 1.0 (if (<= y 1.16e-86) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.7e-64) {
tmp = 1.0;
} else if (y <= 1.16e-86) {
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.7d-64)) then
tmp = 1.0d0
else if (y <= 1.16d-86) 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.7e-64) {
tmp = 1.0;
} else if (y <= 1.16e-86) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.7e-64: tmp = 1.0 elif y <= 1.16e-86: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.7e-64) tmp = 1.0; elseif (y <= 1.16e-86) 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.7e-64) tmp = 1.0; elseif (y <= 1.16e-86) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.7e-64], 1.0, If[LessEqual[y, 1.16e-86], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-64}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{-86}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.69999999999999986e-64 or 1.16e-86 < y Initial program 99.9%
Taylor expanded in x around 0 84.8%
if -2.69999999999999986e-64 < y < 1.16e-86Initial program 97.1%
Taylor expanded in y around 0 76.5%
Final simplification81.4%
(FPCore (x y z t) :precision binary64 (if (<= t -4.8e-52) 1.0 (if (<= t 4.4e-65) (+ 1.0 (/ x (* y z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.8e-52) {
tmp = 1.0;
} else if (t <= 4.4e-65) {
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 <= (-4.8d-52)) then
tmp = 1.0d0
else if (t <= 4.4d-65) 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 <= -4.8e-52) {
tmp = 1.0;
} else if (t <= 4.4e-65) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.8e-52: tmp = 1.0 elif t <= 4.4e-65: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.8e-52) tmp = 1.0; elseif (t <= 4.4e-65) 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 <= -4.8e-52) tmp = 1.0; elseif (t <= 4.4e-65) tmp = 1.0 + (x / (y * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.8e-52], 1.0, If[LessEqual[t, 4.4e-65], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{-52}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-65}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4.8000000000000003e-52 or 4.40000000000000042e-65 < t Initial program 99.9%
Taylor expanded in x around 0 83.9%
if -4.8000000000000003e-52 < t < 4.40000000000000042e-65Initial program 97.1%
Taylor expanded in z around inf 80.4%
associate-/r*81.3%
Simplified81.3%
Taylor expanded in y around inf 70.8%
*-commutative70.8%
Simplified70.8%
Final simplification78.4%
(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%
Taylor expanded in x around 0 71.0%
herbie shell --seed 2024170
(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)))))