
(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 11 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) (- t y)))))
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - 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 - z) * (t - y)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
def code(x, y, z, t): return 1.0 + (x / ((y - z) * (t - y)))
function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - z) * Float64(t - y)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (x / ((y - z) * (t - y))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{\left(y - z\right) \cdot \left(t - y\right)}
\end{array}
Initial program 98.8%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.6e-18) (not (<= y 1.9e-88))) (+ 1.0 (/ (/ x y) (- t y))) (+ 1.0 (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.6e-18) || !(y <= 1.9e-88)) {
tmp = 1.0 + ((x / y) / (t - y));
} 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 ((y <= (-5.6d-18)) .or. (.not. (y <= 1.9d-88))) then
tmp = 1.0d0 + ((x / y) / (t - y))
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 ((y <= -5.6e-18) || !(y <= 1.9e-88)) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.6e-18) or not (y <= 1.9e-88): tmp = 1.0 + ((x / y) / (t - y)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.6e-18) || !(y <= 1.9e-88)) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); 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 ((y <= -5.6e-18) || ~((y <= 1.9e-88))) tmp = 1.0 + ((x / y) / (t - y)); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.6e-18], N[Not[LessEqual[y, 1.9e-88]], $MachinePrecision]], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $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}\;y \leq -5.6 \cdot 10^{-18} \lor \neg \left(y \leq 1.9 \cdot 10^{-88}\right):\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -5.60000000000000025e-18 or 1.90000000000000006e-88 < y Initial program 100.0%
Taylor expanded in z around 0 92.0%
sub-neg92.0%
associate-/r*92.0%
distribute-neg-frac292.0%
neg-sub092.0%
sub-neg92.0%
+-commutative92.0%
associate--r+92.0%
neg-sub092.0%
remove-double-neg92.0%
Simplified92.0%
if -5.60000000000000025e-18 < y < 1.90000000000000006e-88Initial program 97.1%
Taylor expanded in t around inf 81.5%
associate-/r*81.8%
Simplified81.8%
Final simplification87.8%
(FPCore (x y z t)
:precision binary64
(if (<= t -8.8e-194)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 7.6e-116)
(+ 1.0 (/ x (* y (- z y))))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.8e-194) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 7.6e-116) {
tmp = 1.0 + (x / (y * (z - y)));
} 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 <= (-8.8d-194)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 7.6d-116) then
tmp = 1.0d0 + (x / (y * (z - y)))
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 <= -8.8e-194) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 7.6e-116) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -8.8e-194: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 7.6e-116: tmp = 1.0 + (x / (y * (z - y))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -8.8e-194) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 7.6e-116) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); 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 <= -8.8e-194) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 7.6e-116) tmp = 1.0 + (x / (y * (z - y))); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -8.8e-194], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.6e-116], N[(1.0 + N[(x / N[(y * N[(z - y), $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 -8.8 \cdot 10^{-194}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{-116}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -8.8000000000000005e-194Initial program 99.9%
Taylor expanded in z around inf 81.9%
associate-/r*80.9%
Simplified80.9%
if -8.8000000000000005e-194 < t < 7.6000000000000003e-116Initial program 96.4%
Taylor expanded in t around 0 86.0%
if 7.6000000000000003e-116 < t Initial program 99.7%
Taylor expanded in t around inf 96.0%
associate-/r*96.2%
Simplified96.2%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (<= y -6000000000000.0) 1.0 (if (<= y 1.9e-88) (+ 1.0 (/ (/ x t) (- y z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6000000000000.0) {
tmp = 1.0;
} else if (y <= 1.9e-88) {
tmp = 1.0 + ((x / t) / (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 (y <= (-6000000000000.0d0)) then
tmp = 1.0d0
else if (y <= 1.9d-88) then
tmp = 1.0d0 + ((x / t) / (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 (y <= -6000000000000.0) {
tmp = 1.0;
} else if (y <= 1.9e-88) {
tmp = 1.0 + ((x / t) / (y - z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6000000000000.0: tmp = 1.0 elif y <= 1.9e-88: tmp = 1.0 + ((x / t) / (y - z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6000000000000.0) tmp = 1.0; elseif (y <= 1.9e-88) tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6000000000000.0) tmp = 1.0; elseif (y <= 1.9e-88) tmp = 1.0 + ((x / t) / (y - z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6000000000000.0], 1.0, If[LessEqual[y, 1.9e-88], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6000000000000:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-88}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -6e12 or 1.90000000000000006e-88 < y Initial program 100.0%
Taylor expanded in x around 0 90.8%
if -6e12 < y < 1.90000000000000006e-88Initial program 97.2%
Taylor expanded in t around inf 80.0%
associate-/r*80.3%
Simplified80.3%
(FPCore (x y z t) :precision binary64 (if (<= y -6e-167) 1.0 (if (<= y 3.1e-89) (- 1.0 (/ (/ x z) t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e-167) {
tmp = 1.0;
} else if (y <= 3.1e-89) {
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 <= (-6d-167)) then
tmp = 1.0d0
else if (y <= 3.1d-89) 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 <= -6e-167) {
tmp = 1.0;
} else if (y <= 3.1e-89) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6e-167: tmp = 1.0 elif y <= 3.1e-89: tmp = 1.0 - ((x / z) / t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6e-167) tmp = 1.0; elseif (y <= 3.1e-89) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6e-167) tmp = 1.0; elseif (y <= 3.1e-89) tmp = 1.0 - ((x / z) / t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6e-167], 1.0, If[LessEqual[y, 3.1e-89], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-167}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-89}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -5.9999999999999996e-167 or 3.09999999999999996e-89 < y Initial program 100.0%
Taylor expanded in x around 0 87.1%
if -5.9999999999999996e-167 < y < 3.09999999999999996e-89Initial program 96.0%
Taylor expanded in z around inf 88.1%
associate-/r*90.8%
Simplified90.8%
Taylor expanded in y around 0 80.2%
neg-mul-180.2%
Simplified80.2%
Final simplification85.0%
(FPCore (x y z t) :precision binary64 (if (<= y -2.5e-166) 1.0 (if (<= y 1.1e-88) (/ (- t (/ x z)) t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e-166) {
tmp = 1.0;
} else if (y <= 1.1e-88) {
tmp = (t - (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.5d-166)) then
tmp = 1.0d0
else if (y <= 1.1d-88) then
tmp = (t - (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.5e-166) {
tmp = 1.0;
} else if (y <= 1.1e-88) {
tmp = (t - (x / z)) / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.5e-166: tmp = 1.0 elif y <= 1.1e-88: tmp = (t - (x / z)) / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.5e-166) tmp = 1.0; elseif (y <= 1.1e-88) tmp = Float64(Float64(t - Float64(x / z)) / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.5e-166) tmp = 1.0; elseif (y <= 1.1e-88) tmp = (t - (x / z)) / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.5e-166], 1.0, If[LessEqual[y, 1.1e-88], N[(N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-166}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-88}:\\
\;\;\;\;\frac{t - \frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.5e-166 or 1.10000000000000002e-88 < y Initial program 100.0%
Taylor expanded in x around 0 87.1%
if -2.5e-166 < y < 1.10000000000000002e-88Initial program 96.0%
clear-num96.0%
inv-pow96.0%
associate-/l*91.2%
Applied egg-rr91.2%
unpow-191.2%
Simplified91.2%
Taylor expanded in y around 0 78.6%
associate-/r*79.0%
Simplified79.0%
Taylor expanded in t around 0 80.1%
(FPCore (x y z t) :precision binary64 (if (<= y -2.15e-166) 1.0 (if (<= y 1.3e-88) (- 1.0 (/ (/ x t) z)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.15e-166) {
tmp = 1.0;
} else if (y <= 1.3e-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.15d-166)) then
tmp = 1.0d0
else if (y <= 1.3d-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.15e-166) {
tmp = 1.0;
} else if (y <= 1.3e-88) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.15e-166: tmp = 1.0 elif y <= 1.3e-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.15e-166) tmp = 1.0; elseif (y <= 1.3e-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.15e-166) tmp = 1.0; elseif (y <= 1.3e-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.15e-166], 1.0, If[LessEqual[y, 1.3e-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.15 \cdot 10^{-166}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-88}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.15e-166 or 1.30000000000000007e-88 < y Initial program 100.0%
Taylor expanded in x around 0 87.1%
if -2.15e-166 < y < 1.30000000000000007e-88Initial program 96.0%
clear-num96.0%
inv-pow96.0%
associate-/l*91.2%
Applied egg-rr91.2%
unpow-191.2%
Simplified91.2%
Taylor expanded in y around 0 78.6%
associate-/r*79.0%
Simplified79.0%
(FPCore (x y z t) :precision binary64 (if (<= y -2.5e-166) 1.0 (if (<= y 2.5e-89) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e-166) {
tmp = 1.0;
} else if (y <= 2.5e-89) {
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.5d-166)) then
tmp = 1.0d0
else if (y <= 2.5d-89) 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.5e-166) {
tmp = 1.0;
} else if (y <= 2.5e-89) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.5e-166: tmp = 1.0 elif y <= 2.5e-89: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.5e-166) tmp = 1.0; elseif (y <= 2.5e-89) 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.5e-166) tmp = 1.0; elseif (y <= 2.5e-89) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.5e-166], 1.0, If[LessEqual[y, 2.5e-89], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-166}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-89}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.5e-166 or 2.49999999999999983e-89 < y Initial program 100.0%
Taylor expanded in x around 0 87.1%
if -2.5e-166 < y < 2.49999999999999983e-89Initial program 96.0%
Taylor expanded in y around 0 78.6%
Final simplification84.6%
(FPCore (x y z t) :precision binary64 (if (<= y -5.5e-247) 1.0 (if (<= y -2.1e-290) (/ x (* z (- t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e-247) {
tmp = 1.0;
} else if (y <= -2.1e-290) {
tmp = 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 <= (-5.5d-247)) then
tmp = 1.0d0
else if (y <= (-2.1d-290)) then
tmp = 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 <= -5.5e-247) {
tmp = 1.0;
} else if (y <= -2.1e-290) {
tmp = x / (z * -t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.5e-247: tmp = 1.0 elif y <= -2.1e-290: tmp = x / (z * -t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.5e-247) tmp = 1.0; elseif (y <= -2.1e-290) tmp = Float64(x / Float64(z * Float64(-t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.5e-247) tmp = 1.0; elseif (y <= -2.1e-290) tmp = x / (z * -t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.5e-247], 1.0, If[LessEqual[y, -2.1e-290], N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-247}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-290}:\\
\;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -5.49999999999999995e-247 or -2.1000000000000001e-290 < y Initial program 98.7%
Taylor expanded in x around 0 78.4%
if -5.49999999999999995e-247 < y < -2.1000000000000001e-290Initial program 99.8%
Taylor expanded in x around inf 84.9%
mul-1-neg84.9%
*-commutative84.9%
distribute-neg-frac284.9%
distribute-rgt-neg-out84.9%
neg-sub084.9%
sub-neg84.9%
+-commutative84.9%
associate--r+84.9%
neg-sub084.9%
remove-double-neg84.9%
Simplified84.9%
Taylor expanded in y around 0 84.9%
associate-*r*84.9%
neg-mul-184.9%
Simplified84.9%
Final simplification78.7%
(FPCore (x y z t) :precision binary64 (if (<= t 2.6e-114) (+ 1.0 (/ (/ x z) (- y t))) (+ 1.0 (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.6e-114) {
tmp = 1.0 + ((x / z) / (y - t));
} 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 <= 2.6d-114) then
tmp = 1.0d0 + ((x / z) / (y - t))
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 <= 2.6e-114) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2.6e-114: tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2.6e-114) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); 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 <= 2.6e-114) tmp = 1.0 + ((x / z) / (y - t)); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2.6e-114], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $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 2.6 \cdot 10^{-114}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 2.60000000000000013e-114Initial program 98.3%
Taylor expanded in z around inf 78.8%
associate-/r*79.9%
Simplified79.9%
if 2.60000000000000013e-114 < t Initial program 99.7%
Taylor expanded in t around inf 96.0%
associate-/r*96.2%
Simplified96.2%
(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 75.3%
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)))))