
(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 14 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}
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (/ (/ -1.0 (- y t)) (/ (- y z) x))))
assert(z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((-1.0 / (y - t)) / ((y - z) / x));
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 + (((-1.0d0) / (y - t)) / ((y - z) / x))
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + ((-1.0 / (y - t)) / ((y - z) / x));
}
[z, t] = sort([z, t]) def code(x, y, z, t): return 1.0 + ((-1.0 / (y - t)) / ((y - z) / x))
z, t = sort([z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(Float64(-1.0 / Float64(y - t)) / Float64(Float64(y - z) / x))) end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((-1.0 / (y - t)) / ((y - z) / x));
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[(-1.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] / N[(N[(y - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
1 + \frac{\frac{-1}{y - t}}{\frac{y - z}{x}}
\end{array}
Initial program 98.6%
clear-num98.6%
inv-pow98.6%
*-commutative98.6%
associate-/l*98.1%
Applied egg-rr98.1%
unpow-198.1%
clear-num98.1%
clear-num98.1%
associate-/l/98.7%
associate-/r*98.7%
Applied egg-rr98.7%
Final simplification98.7%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ (/ x y) y))))
(if (<= y -62000000000.0)
t_1
(if (<= y -9e-118)
(+ 1.0 (/ x (* y t)))
(if (<= y 4e-46) (- 1.0 (/ (/ x z) t)) t_1)))))assert(z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - ((x / y) / y);
double tmp;
if (y <= -62000000000.0) {
tmp = t_1;
} else if (y <= -9e-118) {
tmp = 1.0 + (x / (y * t));
} else if (y <= 4e-46) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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) / y)
if (y <= (-62000000000.0d0)) then
tmp = t_1
else if (y <= (-9d-118)) then
tmp = 1.0d0 + (x / (y * t))
else if (y <= 4d-46) then
tmp = 1.0d0 - ((x / z) / t)
else
tmp = t_1
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - ((x / y) / y);
double tmp;
if (y <= -62000000000.0) {
tmp = t_1;
} else if (y <= -9e-118) {
tmp = 1.0 + (x / (y * t));
} else if (y <= 4e-46) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = t_1;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): t_1 = 1.0 - ((x / y) / y) tmp = 0 if y <= -62000000000.0: tmp = t_1 elif y <= -9e-118: tmp = 1.0 + (x / (y * t)) elif y <= 4e-46: tmp = 1.0 - ((x / z) / t) else: tmp = t_1 return tmp
z, t = sort([z, t]) function code(x, y, z, t) t_1 = Float64(1.0 - Float64(Float64(x / y) / y)) tmp = 0.0 if (y <= -62000000000.0) tmp = t_1; elseif (y <= -9e-118) tmp = Float64(1.0 + Float64(x / Float64(y * t))); elseif (y <= 4e-46) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); else tmp = t_1; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 - ((x / y) / y);
tmp = 0.0;
if (y <= -62000000000.0)
tmp = t_1;
elseif (y <= -9e-118)
tmp = 1.0 + (x / (y * t));
elseif (y <= 4e-46)
tmp = 1.0 - ((x / z) / t);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -62000000000.0], t$95$1, If[LessEqual[y, -9e-118], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e-46], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := 1 - \frac{\frac{x}{y}}{y}\\
\mathbf{if}\;y \leq -62000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-118}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-46}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -6.2e10 or 4.00000000000000009e-46 < y Initial program 100.0%
Taylor expanded in t around 0 98.0%
*-commutative98.0%
associate-/r*98.0%
Simplified98.0%
Taylor expanded in y around inf 93.2%
if -6.2e10 < y < -9.0000000000000001e-118Initial program 99.8%
clear-num99.7%
inv-pow99.7%
*-commutative99.7%
associate-/l*92.9%
Applied egg-rr92.9%
Taylor expanded in t around inf 78.4%
mul-1-neg78.4%
associate-/r*78.4%
distribute-neg-frac78.4%
distribute-neg-frac78.4%
Simplified78.4%
Taylor expanded in y around inf 60.6%
associate-*r/60.6%
neg-mul-160.6%
Simplified60.6%
if -9.0000000000000001e-118 < y < 4.00000000000000009e-46Initial program 96.3%
Taylor expanded in y around 0 73.9%
*-un-lft-identity73.9%
times-frac74.7%
Applied egg-rr74.7%
associate-*l/74.7%
*-lft-identity74.7%
Simplified74.7%
Final simplification83.1%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -1.85e-118) (not (<= y 6.4e-83))) (- 1.0 (/ x (* y (- y t)))) (- 1.0 (/ (/ x z) t))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.85e-118) || !(y <= 6.4e-83)) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - ((x / z) / t);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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.85d-118)) .or. (.not. (y <= 6.4d-83))) then
tmp = 1.0d0 - (x / (y * (y - t)))
else
tmp = 1.0d0 - ((x / z) / t)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.85e-118) || !(y <= 6.4e-83)) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - ((x / z) / t);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if (y <= -1.85e-118) or not (y <= 6.4e-83): tmp = 1.0 - (x / (y * (y - t))) else: tmp = 1.0 - ((x / z) / t) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -1.85e-118) || !(y <= 6.4e-83)) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); else tmp = Float64(1.0 - Float64(Float64(x / z) / t)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -1.85e-118) || ~((y <= 6.4e-83)))
tmp = 1.0 - (x / (y * (y - t)));
else
tmp = 1.0 - ((x / z) / t);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.85e-118], N[Not[LessEqual[y, 6.4e-83]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-118} \lor \neg \left(y \leq 6.4 \cdot 10^{-83}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\end{array}
\end{array}
if y < -1.85000000000000007e-118 or 6.4000000000000002e-83 < y Initial program 100.0%
Taylor expanded in z around 0 90.9%
if -1.85000000000000007e-118 < y < 6.4000000000000002e-83Initial program 96.2%
Taylor expanded in y around 0 74.9%
*-un-lft-identity74.9%
times-frac75.7%
Applied egg-rr75.7%
associate-*l/75.7%
*-lft-identity75.7%
Simplified75.7%
Final simplification85.6%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= t -1.65e-124) (not (<= t 1.8e-196))) (+ 1.0 (/ x (* t (- y z)))) (- 1.0 (/ (/ x (- y z)) y))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.65e-124) || !(t <= 1.8e-196)) {
tmp = 1.0 + (x / (t * (y - z)));
} else {
tmp = 1.0 - ((x / (y - z)) / y);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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.65d-124)) .or. (.not. (t <= 1.8d-196))) then
tmp = 1.0d0 + (x / (t * (y - z)))
else
tmp = 1.0d0 - ((x / (y - z)) / y)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.65e-124) || !(t <= 1.8e-196)) {
tmp = 1.0 + (x / (t * (y - z)));
} else {
tmp = 1.0 - ((x / (y - z)) / y);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if (t <= -1.65e-124) or not (t <= 1.8e-196): tmp = 1.0 + (x / (t * (y - z))) else: tmp = 1.0 - ((x / (y - z)) / y) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if ((t <= -1.65e-124) || !(t <= 1.8e-196)) tmp = Float64(1.0 + Float64(x / Float64(t * Float64(y - z)))); else tmp = Float64(1.0 - Float64(Float64(x / Float64(y - z)) / y)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((t <= -1.65e-124) || ~((t <= 1.8e-196)))
tmp = 1.0 + (x / (t * (y - z)));
else
tmp = 1.0 - ((x / (y - z)) / y);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.65e-124], N[Not[LessEqual[t, 1.8e-196]], $MachinePrecision]], N[(1.0 + N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{-124} \lor \neg \left(t \leq 1.8 \cdot 10^{-196}\right):\\
\;\;\;\;1 + \frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\
\end{array}
\end{array}
if t < -1.64999999999999992e-124 or 1.8e-196 < t Initial program 99.9%
Taylor expanded in t around inf 90.7%
associate-*r/90.7%
neg-mul-190.7%
Simplified90.7%
if -1.64999999999999992e-124 < t < 1.8e-196Initial program 94.8%
Taylor expanded in t around 0 89.8%
*-commutative89.8%
associate-/r*90.7%
Simplified90.7%
Final simplification90.7%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.45e-118) (- 1.0 (/ x (* y (- y t)))) (if (<= y 9.6e-48) (- 1.0 (/ (/ x z) t)) (- 1.0 (/ x (* y (- y z)))))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.45e-118) {
tmp = 1.0 - (x / (y * (y - t)));
} else if (y <= 9.6e-48) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0 - (x / (y * (y - z)));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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.45d-118)) then
tmp = 1.0d0 - (x / (y * (y - t)))
else if (y <= 9.6d-48) then
tmp = 1.0d0 - ((x / z) / t)
else
tmp = 1.0d0 - (x / (y * (y - z)))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.45e-118) {
tmp = 1.0 - (x / (y * (y - t)));
} else if (y <= 9.6e-48) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0 - (x / (y * (y - z)));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.45e-118: tmp = 1.0 - (x / (y * (y - t))) elif y <= 9.6e-48: tmp = 1.0 - ((x / z) / t) else: tmp = 1.0 - (x / (y * (y - z))) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.45e-118) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); elseif (y <= 9.6e-48) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); else tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1.45e-118)
tmp = 1.0 - (x / (y * (y - t)));
elseif (y <= 9.6e-48)
tmp = 1.0 - ((x / z) / t);
else
tmp = 1.0 - (x / (y * (y - z)));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.45e-118], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.6e-48], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-118}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-48}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -1.4499999999999999e-118Initial program 99.9%
Taylor expanded in z around 0 87.7%
if -1.4499999999999999e-118 < y < 9.6e-48Initial program 96.3%
Taylor expanded in y around 0 73.9%
*-un-lft-identity73.9%
times-frac74.7%
Applied egg-rr74.7%
associate-*l/74.7%
*-lft-identity74.7%
Simplified74.7%
if 9.6e-48 < y Initial program 100.0%
Taylor expanded in t around 0 98.6%
Final simplification86.3%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.3e-118) (- 1.0 (/ (/ x (- y t)) y)) (if (<= y 6.5e-48) (- 1.0 (/ (/ x z) t)) (- 1.0 (/ x (* y (- y z)))))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3e-118) {
tmp = 1.0 - ((x / (y - t)) / y);
} else if (y <= 6.5e-48) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0 - (x / (y * (y - z)));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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.3d-118)) then
tmp = 1.0d0 - ((x / (y - t)) / y)
else if (y <= 6.5d-48) then
tmp = 1.0d0 - ((x / z) / t)
else
tmp = 1.0d0 - (x / (y * (y - z)))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3e-118) {
tmp = 1.0 - ((x / (y - t)) / y);
} else if (y <= 6.5e-48) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0 - (x / (y * (y - z)));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if y <= -2.3e-118: tmp = 1.0 - ((x / (y - t)) / y) elif y <= 6.5e-48: tmp = 1.0 - ((x / z) / t) else: tmp = 1.0 - (x / (y * (y - z))) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.3e-118) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - t)) / y)); elseif (y <= 6.5e-48) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); else tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -2.3e-118)
tmp = 1.0 - ((x / (y - t)) / y);
elseif (y <= 6.5e-48)
tmp = 1.0 - ((x / z) / t);
else
tmp = 1.0 - (x / (y * (y - z)));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -2.3e-118], N[(1.0 - N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e-48], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-118}:\\
\;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-48}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -2.30000000000000021e-118Initial program 99.9%
Taylor expanded in z around 0 87.7%
*-commutative87.7%
associate-/r*87.7%
Simplified87.7%
if -2.30000000000000021e-118 < y < 6.5e-48Initial program 96.3%
Taylor expanded in y around 0 73.9%
*-un-lft-identity73.9%
times-frac74.7%
Applied egg-rr74.7%
associate-*l/74.7%
*-lft-identity74.7%
Simplified74.7%
if 6.5e-48 < y Initial program 100.0%
Taylor expanded in t around 0 98.6%
Final simplification86.3%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -1.1e-121) (+ 1.0 (/ x (* (- y t) z))) (- 1.0 (* (/ -1.0 (- y z)) (/ x t)))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e-121) {
tmp = 1.0 + (x / ((y - t) * z));
} else {
tmp = 1.0 - ((-1.0 / (y - z)) * (x / t));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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.1d-121)) then
tmp = 1.0d0 + (x / ((y - t) * z))
else
tmp = 1.0d0 - (((-1.0d0) / (y - z)) * (x / t))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e-121) {
tmp = 1.0 + (x / ((y - t) * z));
} else {
tmp = 1.0 - ((-1.0 / (y - z)) * (x / t));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.1e-121: tmp = 1.0 + (x / ((y - t) * z)) else: tmp = 1.0 - ((-1.0 / (y - z)) * (x / t)) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.1e-121) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - t) * z))); else tmp = Float64(1.0 - Float64(Float64(-1.0 / Float64(y - z)) * Float64(x / t))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.1e-121)
tmp = 1.0 + (x / ((y - t) * z));
else
tmp = 1.0 - ((-1.0 / (y - z)) * (x / t));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.1e-121], N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(-1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-121}:\\
\;\;\;\;1 + \frac{x}{\left(y - t\right) \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{-1}{y - z} \cdot \frac{x}{t}\\
\end{array}
\end{array}
if z < -1.10000000000000011e-121Initial program 99.9%
Taylor expanded in z around inf 91.6%
associate-*r/91.6%
neg-mul-191.6%
*-commutative91.6%
Simplified91.6%
if -1.10000000000000011e-121 < z Initial program 97.9%
clear-num97.9%
inv-pow97.9%
*-commutative97.9%
associate-/l*97.1%
Applied egg-rr97.1%
Taylor expanded in t around inf 80.1%
mul-1-neg80.1%
associate-/r*81.1%
distribute-neg-frac81.1%
distribute-neg-frac81.1%
Simplified81.1%
associate-/l/80.1%
neg-mul-180.1%
times-frac81.1%
Applied egg-rr81.1%
Final simplification84.8%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -62000000000.0) (not (<= y 7.5e-45))) (- 1.0 (/ (/ x y) y)) (- 1.0 (/ x (* t z)))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -62000000000.0) || !(y <= 7.5e-45)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - (x / (t * z));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 <= (-62000000000.0d0)) .or. (.not. (y <= 7.5d-45))) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 - (x / (t * z))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -62000000000.0) || !(y <= 7.5e-45)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - (x / (t * z));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if (y <= -62000000000.0) or not (y <= 7.5e-45): tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 - (x / (t * z)) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -62000000000.0) || !(y <= 7.5e-45)) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 - Float64(x / Float64(t * z))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -62000000000.0) || ~((y <= 7.5e-45)))
tmp = 1.0 - ((x / y) / y);
else
tmp = 1.0 - (x / (t * z));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[y, -62000000000.0], N[Not[LessEqual[y, 7.5e-45]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -62000000000 \lor \neg \left(y \leq 7.5 \cdot 10^{-45}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\end{array}
\end{array}
if y < -6.2e10 or 7.5000000000000006e-45 < y Initial program 100.0%
Taylor expanded in t around 0 98.0%
*-commutative98.0%
associate-/r*98.0%
Simplified98.0%
Taylor expanded in y around inf 93.2%
if -6.2e10 < y < 7.5000000000000006e-45Initial program 97.1%
Taylor expanded in y around 0 69.5%
Final simplification82.1%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -65000000000.0) (not (<= y 5.1e-46))) (- 1.0 (/ (/ x y) y)) (- 1.0 (/ (/ x z) t))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -65000000000.0) || !(y <= 5.1e-46)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - ((x / z) / t);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 <= (-65000000000.0d0)) .or. (.not. (y <= 5.1d-46))) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 - ((x / z) / t)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -65000000000.0) || !(y <= 5.1e-46)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - ((x / z) / t);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if (y <= -65000000000.0) or not (y <= 5.1e-46): tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 - ((x / z) / t) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -65000000000.0) || !(y <= 5.1e-46)) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 - Float64(Float64(x / z) / t)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -65000000000.0) || ~((y <= 5.1e-46)))
tmp = 1.0 - ((x / y) / y);
else
tmp = 1.0 - ((x / z) / t);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[y, -65000000000.0], N[Not[LessEqual[y, 5.1e-46]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -65000000000 \lor \neg \left(y \leq 5.1 \cdot 10^{-46}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\end{array}
\end{array}
if y < -6.5e10 or 5.0999999999999997e-46 < y Initial program 100.0%
Taylor expanded in t around 0 98.0%
*-commutative98.0%
associate-/r*98.0%
Simplified98.0%
Taylor expanded in y around inf 93.2%
if -6.5e10 < y < 5.0999999999999997e-46Initial program 97.1%
Taylor expanded in y around 0 69.5%
*-un-lft-identity69.5%
times-frac70.1%
Applied egg-rr70.1%
associate-*l/70.1%
*-lft-identity70.1%
Simplified70.1%
Final simplification82.4%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -6.1e-90) 1.0 (if (<= y 3.8e-75) (- 1.0 (/ x (* t z))) 1.0)))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.1e-90) {
tmp = 1.0;
} else if (y <= 3.8e-75) {
tmp = 1.0 - (x / (t * z));
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 <= (-6.1d-90)) then
tmp = 1.0d0
else if (y <= 3.8d-75) then
tmp = 1.0d0 - (x / (t * z))
else
tmp = 1.0d0
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.1e-90) {
tmp = 1.0;
} else if (y <= 3.8e-75) {
tmp = 1.0 - (x / (t * z));
} else {
tmp = 1.0;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if y <= -6.1e-90: tmp = 1.0 elif y <= 3.8e-75: tmp = 1.0 - (x / (t * z)) else: tmp = 1.0 return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -6.1e-90) tmp = 1.0; elseif (y <= 3.8e-75) tmp = Float64(1.0 - Float64(x / Float64(t * z))); else tmp = 1.0; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -6.1e-90)
tmp = 1.0;
elseif (y <= 3.8e-75)
tmp = 1.0 - (x / (t * z));
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -6.1e-90], 1.0, If[LessEqual[y, 3.8e-75], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.1 \cdot 10^{-90}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-75}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -6.0999999999999999e-90 or 3.79999999999999994e-75 < y Initial program 100.0%
Taylor expanded in z around inf 80.7%
associate-*r/80.7%
neg-mul-180.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in x around 0 88.7%
if -6.0999999999999999e-90 < y < 3.79999999999999994e-75Initial program 96.5%
Taylor expanded in y around 0 69.8%
Final simplification81.3%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -3.7e-108) (+ 1.0 (/ x (* (- y t) z))) (- 1.0 (/ (/ x (- y t)) y))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e-108) {
tmp = 1.0 + (x / ((y - t) * z));
} else {
tmp = 1.0 - ((x / (y - t)) / y);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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.7d-108)) then
tmp = 1.0d0 + (x / ((y - t) * z))
else
tmp = 1.0d0 - ((x / (y - t)) / y)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e-108) {
tmp = 1.0 + (x / ((y - t) * z));
} else {
tmp = 1.0 - ((x / (y - t)) / y);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if z <= -3.7e-108: tmp = 1.0 + (x / ((y - t) * z)) else: tmp = 1.0 - ((x / (y - t)) / y) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -3.7e-108) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - t) * z))); else tmp = Float64(1.0 - Float64(Float64(x / Float64(y - t)) / y)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -3.7e-108)
tmp = 1.0 + (x / ((y - t) * z));
else
tmp = 1.0 - ((x / (y - t)) / y);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -3.7e-108], N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-108}:\\
\;\;\;\;1 + \frac{x}{\left(y - t\right) \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\
\end{array}
\end{array}
if z < -3.7e-108Initial program 99.9%
Taylor expanded in z around inf 93.5%
associate-*r/93.5%
neg-mul-193.5%
*-commutative93.5%
Simplified93.5%
if -3.7e-108 < z Initial program 98.0%
Taylor expanded in z around 0 77.1%
*-commutative77.1%
associate-/r*77.1%
Simplified77.1%
Final simplification82.7%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -7.8e-122) (+ 1.0 (/ x (* (- y t) z))) (+ 1.0 (/ (/ x t) (- y z)))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.8e-122) {
tmp = 1.0 + (x / ((y - t) * z));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 <= (-7.8d-122)) then
tmp = 1.0d0 + (x / ((y - t) * z))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.8e-122) {
tmp = 1.0 + (x / ((y - t) * z));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if z <= -7.8e-122: tmp = 1.0 + (x / ((y - t) * z)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -7.8e-122) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - t) * z))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -7.8e-122)
tmp = 1.0 + (x / ((y - t) * z));
else
tmp = 1.0 + ((x / t) / (y - z));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -7.8e-122], N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{-122}:\\
\;\;\;\;1 + \frac{x}{\left(y - t\right) \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if z < -7.79999999999999979e-122Initial program 99.9%
Taylor expanded in z around inf 91.7%
associate-*r/91.7%
neg-mul-191.7%
*-commutative91.7%
Simplified91.7%
if -7.79999999999999979e-122 < z Initial program 97.9%
clear-num97.9%
inv-pow97.9%
*-commutative97.9%
associate-/l*97.0%
Applied egg-rr97.0%
Taylor expanded in t around inf 80.0%
mul-1-neg80.0%
associate-/r*81.0%
distribute-neg-frac81.0%
distribute-neg-frac81.0%
Simplified81.0%
Final simplification84.8%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y t) (- y z)))))
assert(z < t);
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - t) * (y - z)));
}
NOTE: z and t should be sorted in increasing order before calling this function.
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) * (y - z)))
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - t) * (y - z)));
}
[z, t] = sort([z, t]) def code(x, y, z, t): return 1.0 - (x / ((y - t) * (y - z)))
z, t = sort([z, t]) function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - t) * Float64(y - z)))) end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - (x / ((y - t) * (y - z)));
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
1 - \frac{x}{\left(y - t\right) \cdot \left(y - z\right)}
\end{array}
Initial program 98.6%
Final simplification98.6%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 1.0)
assert(z < t);
double code(double x, double y, double z, double t) {
return 1.0;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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
assert z < t;
public static double code(double x, double y, double z, double t) {
return 1.0;
}
[z, t] = sort([z, t]) def code(x, y, z, t): return 1.0
z, t = sort([z, t]) function code(x, y, z, t) return 1.0 end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
1
\end{array}
Initial program 98.6%
Taylor expanded in z around inf 81.2%
associate-*r/81.2%
neg-mul-181.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in x around 0 73.6%
Final simplification73.6%
herbie shell --seed 2023308
(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)))))