
(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 8 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 99.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- 1.0 (/ x (* (- y z) (- y t)))))) (if (or (<= t_1 -2.0) (not (<= t_1 2.0))) (/ x (* (- y t) z)) 1.0)))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / ((y - z) * (y - t)));
double tmp;
if ((t_1 <= -2.0) || !(t_1 <= 2.0)) {
tmp = x / ((y - 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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - (x / ((y - z) * (y - t)))
if ((t_1 <= (-2.0d0)) .or. (.not. (t_1 <= 2.0d0))) then
tmp = x / ((y - 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 t_1 = 1.0 - (x / ((y - z) * (y - t)));
double tmp;
if ((t_1 <= -2.0) || !(t_1 <= 2.0)) {
tmp = x / ((y - t) * z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - (x / ((y - z) * (y - t))) tmp = 0 if (t_1 <= -2.0) or not (t_1 <= 2.0): tmp = x / ((y - t) * z) else: tmp = 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) tmp = 0.0 if ((t_1 <= -2.0) || !(t_1 <= 2.0)) tmp = Float64(x / Float64(Float64(y - t) * z)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - (x / ((y - z) * (y - t))); tmp = 0.0; if ((t_1 <= -2.0) || ~((t_1 <= 2.0))) tmp = x / ((y - t) * z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2.0], N[Not[LessEqual[t$95$1, 2.0]], $MachinePrecision]], N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
\mathbf{if}\;t\_1 \leq -2 \lor \neg \left(t\_1 \leq 2\right):\\
\;\;\;\;\frac{x}{\left(y - t\right) \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < -2 or 2 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) Initial program 98.4%
Taylor expanded in x around inf
mul-1-negN/A
associate-/r*N/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
mul-1-negN/A
remove-double-negN/A
lower--.f6489.8
Applied rewrites89.8%
Taylor expanded in z around inf
Applied rewrites53.5%
if -2 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 2Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites99.2%
Final simplification86.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- 1.0 (/ x (* (- y z) (- y t)))))) (if (or (<= t_1 -2.0) (not (<= t_1 2.0))) (/ (- x) (* z t)) 1.0)))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / ((y - z) * (y - t)));
double tmp;
if ((t_1 <= -2.0) || !(t_1 <= 2.0)) {
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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - (x / ((y - z) * (y - t)))
if ((t_1 <= (-2.0d0)) .or. (.not. (t_1 <= 2.0d0))) 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 t_1 = 1.0 - (x / ((y - z) * (y - t)));
double tmp;
if ((t_1 <= -2.0) || !(t_1 <= 2.0)) {
tmp = -x / (z * t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - (x / ((y - z) * (y - t))) tmp = 0 if (t_1 <= -2.0) or not (t_1 <= 2.0): tmp = -x / (z * t) else: tmp = 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) tmp = 0.0 if ((t_1 <= -2.0) || !(t_1 <= 2.0)) tmp = Float64(Float64(-x) / Float64(z * t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - (x / ((y - z) * (y - t))); tmp = 0.0; if ((t_1 <= -2.0) || ~((t_1 <= 2.0))) tmp = -x / (z * t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2.0], N[Not[LessEqual[t$95$1, 2.0]], $MachinePrecision]], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
\mathbf{if}\;t\_1 \leq -2 \lor \neg \left(t\_1 \leq 2\right):\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < -2 or 2 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) Initial program 98.4%
Taylor expanded in x around inf
mul-1-negN/A
associate-/r*N/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
mul-1-negN/A
remove-double-negN/A
lower--.f6489.8
Applied rewrites89.8%
Taylor expanded in y around 0
Applied rewrites40.7%
if -2 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 2Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites99.2%
Final simplification82.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* (- y z) (- y t)))))
(if (<= t_1 -1e+18)
(/ x (* (- y t) z))
(if (<= t_1 5e-6) 1.0 (/ (- x) (* (- z y) t))))))
double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (y - t));
double tmp;
if (t_1 <= -1e+18) {
tmp = x / ((y - t) * z);
} else if (t_1 <= 5e-6) {
tmp = 1.0;
} else {
tmp = -x / ((z - 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) :: t_1
real(8) :: tmp
t_1 = x / ((y - z) * (y - t))
if (t_1 <= (-1d+18)) then
tmp = x / ((y - t) * z)
else if (t_1 <= 5d-6) then
tmp = 1.0d0
else
tmp = -x / ((z - y) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (y - t));
double tmp;
if (t_1 <= -1e+18) {
tmp = x / ((y - t) * z);
} else if (t_1 <= 5e-6) {
tmp = 1.0;
} else {
tmp = -x / ((z - y) * t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x / ((y - z) * (y - t)) tmp = 0 if t_1 <= -1e+18: tmp = x / ((y - t) * z) elif t_1 <= 5e-6: tmp = 1.0 else: tmp = -x / ((z - y) * t) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(y - z) * Float64(y - t))) tmp = 0.0 if (t_1 <= -1e+18) tmp = Float64(x / Float64(Float64(y - t) * z)); elseif (t_1 <= 5e-6) tmp = 1.0; else tmp = Float64(Float64(-x) / Float64(Float64(z - y) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / ((y - z) * (y - t)); tmp = 0.0; if (t_1 <= -1e+18) tmp = x / ((y - t) * z); elseif (t_1 <= 5e-6) tmp = 1.0; else tmp = -x / ((z - y) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+18], N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-6], 1.0, N[((-x) / N[(N[(z - y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;\frac{x}{\left(y - t\right) \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\left(z - y\right) \cdot t}\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < -1e18Initial program 99.7%
Taylor expanded in x around inf
mul-1-negN/A
associate-/r*N/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
mul-1-negN/A
remove-double-negN/A
lower--.f6491.9
Applied rewrites91.9%
Taylor expanded in z around inf
Applied rewrites53.9%
if -1e18 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < 5.00000000000000041e-6Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites99.2%
if 5.00000000000000041e-6 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) Initial program 97.1%
Taylor expanded in x around inf
mul-1-negN/A
associate-/r*N/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
mul-1-negN/A
remove-double-negN/A
lower--.f6487.8
Applied rewrites87.8%
Taylor expanded in t around inf
Applied rewrites55.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* (- y z) (- y t))))) (if (or (<= t_1 -5e+21) (not (<= t_1 10.0))) (/ x (* z y)) 1.0)))
double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (y - t));
double tmp;
if ((t_1 <= -5e+21) || !(t_1 <= 10.0)) {
tmp = x / (z * y);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / ((y - z) * (y - t))
if ((t_1 <= (-5d+21)) .or. (.not. (t_1 <= 10.0d0))) then
tmp = x / (z * y)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (y - t));
double tmp;
if ((t_1 <= -5e+21) || !(t_1 <= 10.0)) {
tmp = x / (z * y);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / ((y - z) * (y - t)) tmp = 0 if (t_1 <= -5e+21) or not (t_1 <= 10.0): tmp = x / (z * y) else: tmp = 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(y - z) * Float64(y - t))) tmp = 0.0 if ((t_1 <= -5e+21) || !(t_1 <= 10.0)) tmp = Float64(x / Float64(z * y)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / ((y - z) * (y - t)); tmp = 0.0; if ((t_1 <= -5e+21) || ~((t_1 <= 10.0))) tmp = x / (z * y); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+21], N[Not[LessEqual[t$95$1, 10.0]], $MachinePrecision]], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+21} \lor \neg \left(t\_1 \leq 10\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < -5e21 or 10 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) Initial program 98.4%
Taylor expanded in x around inf
mul-1-negN/A
associate-/r*N/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
mul-1-negN/A
remove-double-negN/A
lower--.f6491.6
Applied rewrites91.6%
Taylor expanded in z around inf
Applied rewrites54.1%
Taylor expanded in y around inf
Applied rewrites26.2%
if -5e21 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < 10Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites97.7%
Final simplification78.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* (- y z) (- y t)))))
(if (<= t_1 -5e+41)
(/ (- x) (* y y))
(if (<= t_1 10.0) 1.0 (/ x (* z y))))))
double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (y - t));
double tmp;
if (t_1 <= -5e+41) {
tmp = -x / (y * y);
} else if (t_1 <= 10.0) {
tmp = 1.0;
} else {
tmp = x / (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) :: t_1
real(8) :: tmp
t_1 = x / ((y - z) * (y - t))
if (t_1 <= (-5d+41)) then
tmp = -x / (y * y)
else if (t_1 <= 10.0d0) then
tmp = 1.0d0
else
tmp = x / (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (y - t));
double tmp;
if (t_1 <= -5e+41) {
tmp = -x / (y * y);
} else if (t_1 <= 10.0) {
tmp = 1.0;
} else {
tmp = x / (z * y);
}
return tmp;
}
def code(x, y, z, t): t_1 = x / ((y - z) * (y - t)) tmp = 0 if t_1 <= -5e+41: tmp = -x / (y * y) elif t_1 <= 10.0: tmp = 1.0 else: tmp = x / (z * y) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(y - z) * Float64(y - t))) tmp = 0.0 if (t_1 <= -5e+41) tmp = Float64(Float64(-x) / Float64(y * y)); elseif (t_1 <= 10.0) tmp = 1.0; else tmp = Float64(x / Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / ((y - z) * (y - t)); tmp = 0.0; if (t_1 <= -5e+41) tmp = -x / (y * y); elseif (t_1 <= 10.0) tmp = 1.0; else tmp = x / (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+41], N[((-x) / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 10.0], 1.0, N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+41}:\\
\;\;\;\;\frac{-x}{y \cdot y}\\
\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot y}\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < -5.00000000000000022e41Initial program 99.7%
Taylor expanded in x around inf
mul-1-negN/A
associate-/r*N/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
mul-1-negN/A
remove-double-negN/A
lower--.f6491.1
Applied rewrites91.1%
Taylor expanded in y around inf
Applied rewrites50.1%
if -5.00000000000000022e41 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < 10Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites96.8%
if 10 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) Initial program 97.0%
Taylor expanded in x around inf
mul-1-negN/A
associate-/r*N/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
mul-1-negN/A
remove-double-negN/A
lower--.f6491.6
Applied rewrites91.6%
Taylor expanded in z around inf
Applied rewrites55.6%
Taylor expanded in y around inf
Applied rewrites27.0%
(FPCore (x y z t) :precision binary64 (if (<= t 2.1e-242) (- 1.0 (/ x (* (- t y) z))) (if (<= t 2.4e-61) (- 1.0 (/ x (* y y))) (- 1.0 (/ x (* (- z y) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.1e-242) {
tmp = 1.0 - (x / ((t - y) * z));
} else if (t <= 2.4e-61) {
tmp = 1.0 - (x / (y * y));
} else {
tmp = 1.0 - (x / ((z - 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 (t <= 2.1d-242) then
tmp = 1.0d0 - (x / ((t - y) * z))
else if (t <= 2.4d-61) then
tmp = 1.0d0 - (x / (y * y))
else
tmp = 1.0d0 - (x / ((z - y) * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.1e-242) {
tmp = 1.0 - (x / ((t - y) * z));
} else if (t <= 2.4e-61) {
tmp = 1.0 - (x / (y * y));
} else {
tmp = 1.0 - (x / ((z - y) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2.1e-242: tmp = 1.0 - (x / ((t - y) * z)) elif t <= 2.4e-61: tmp = 1.0 - (x / (y * y)) else: tmp = 1.0 - (x / ((z - y) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2.1e-242) tmp = Float64(1.0 - Float64(x / Float64(Float64(t - y) * z))); elseif (t <= 2.4e-61) tmp = Float64(1.0 - Float64(x / Float64(y * y))); else tmp = Float64(1.0 - Float64(x / Float64(Float64(z - y) * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 2.1e-242) tmp = 1.0 - (x / ((t - y) * z)); elseif (t <= 2.4e-61) tmp = 1.0 - (x / (y * y)); else tmp = 1.0 - (x / ((z - y) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2.1e-242], N[(1.0 - N[(x / N[(N[(t - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-61], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(N[(z - y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.1 \cdot 10^{-242}:\\
\;\;\;\;1 - \frac{x}{\left(t - y\right) \cdot z}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-61}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{\left(z - y\right) \cdot t}\\
\end{array}
\end{array}
if t < 2.10000000000000019e-242Initial program 99.2%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
mul-1-negN/A
remove-double-negN/A
lower--.f6478.9
Applied rewrites78.9%
if 2.10000000000000019e-242 < t < 2.4000000000000001e-61Initial program 99.9%
Taylor expanded in y around inf
unpow2N/A
lower-*.f6472.2
Applied rewrites72.2%
if 2.4000000000000001e-61 < t Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
mul-1-negN/A
remove-double-negN/A
lower--.f6498.6
Applied rewrites98.6%
(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 99.5%
Taylor expanded in x around 0
Applied rewrites71.8%
herbie shell --seed 2024318
(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)))))