
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
NOTE: x, y, 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)) (/ -1.0 (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((x / (y - t)) * (-1.0 / (y - z)));
}
NOTE: x, y, 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)) * ((-1.0d0) / (y - z)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + ((x / (y - t)) * (-1.0 / (y - z)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((x / (y - t)) * (-1.0 / (y - z)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(Float64(x / Float64(y - t)) * Float64(-1.0 / Float64(y - z)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((x / (y - t)) * (-1.0 / (y - z)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{x}{y - t} \cdot \frac{-1}{y - z}
\end{array}
Initial program 98.8%
*-un-lft-identity98.8%
times-frac99.2%
Applied egg-rr99.2%
Final simplification99.2%
NOTE: x, y, 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 t))))) (t_2 (+ 1.0 (/ (/ x z) (- y t)))))
(if (<= z -4e-14)
t_2
(if (<= z -2.6e-146)
t_1
(if (<= z -3.3e-190)
t_2
(if (<= z 1.45e-140) t_1 (- 1.0 (/ (/ x t) z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / (y * (y - t)));
double t_2 = 1.0 + ((x / z) / (y - t));
double tmp;
if (z <= -4e-14) {
tmp = t_2;
} else if (z <= -2.6e-146) {
tmp = t_1;
} else if (z <= -3.3e-190) {
tmp = t_2;
} else if (z <= 1.45e-140) {
tmp = t_1;
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
NOTE: x, y, 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) :: t_2
real(8) :: tmp
t_1 = 1.0d0 - (x / (y * (y - t)))
t_2 = 1.0d0 + ((x / z) / (y - t))
if (z <= (-4d-14)) then
tmp = t_2
else if (z <= (-2.6d-146)) then
tmp = t_1
else if (z <= (-3.3d-190)) then
tmp = t_2
else if (z <= 1.45d-140) then
tmp = t_1
else
tmp = 1.0d0 - ((x / t) / z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / (y * (y - t)));
double t_2 = 1.0 + ((x / z) / (y - t));
double tmp;
if (z <= -4e-14) {
tmp = t_2;
} else if (z <= -2.6e-146) {
tmp = t_1;
} else if (z <= -3.3e-190) {
tmp = t_2;
} else if (z <= 1.45e-140) {
tmp = t_1;
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 - (x / (y * (y - t))) t_2 = 1.0 + ((x / z) / (y - t)) tmp = 0 if z <= -4e-14: tmp = t_2 elif z <= -2.6e-146: tmp = t_1 elif z <= -3.3e-190: tmp = t_2 elif z <= 1.45e-140: tmp = t_1 else: tmp = 1.0 - ((x / t) / z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))) t_2 = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))) tmp = 0.0 if (z <= -4e-14) tmp = t_2; elseif (z <= -2.6e-146) tmp = t_1; elseif (z <= -3.3e-190) tmp = t_2; elseif (z <= 1.45e-140) tmp = t_1; else tmp = Float64(1.0 - Float64(Float64(x / t) / z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 - (x / (y * (y - t)));
t_2 = 1.0 + ((x / z) / (y - t));
tmp = 0.0;
if (z <= -4e-14)
tmp = t_2;
elseif (z <= -2.6e-146)
tmp = t_1;
elseif (z <= -3.3e-190)
tmp = t_2;
elseif (z <= 1.45e-140)
tmp = t_1;
else
tmp = 1.0 - ((x / t) / z);
end
tmp_2 = tmp;
end
NOTE: x, y, 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[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e-14], t$95$2, If[LessEqual[z, -2.6e-146], t$95$1, If[LessEqual[z, -3.3e-190], t$95$2, If[LessEqual[z, 1.45e-140], t$95$1, N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 1 - \frac{x}{y \cdot \left(y - t\right)}\\
t_2 := 1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{if}\;z \leq -4 \cdot 10^{-14}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-146}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-190}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-140}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if z < -4e-14 or -2.59999999999999987e-146 < z < -3.30000000000000019e-190Initial program 98.8%
sub-neg98.8%
distribute-frac-neg98.8%
*-lft-identity98.8%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 96.4%
associate-/r*97.6%
Simplified97.6%
if -4e-14 < z < -2.59999999999999987e-146 or -3.30000000000000019e-190 < z < 1.44999999999999999e-140Initial program 97.8%
Taylor expanded in z around 0 90.8%
if 1.44999999999999999e-140 < z Initial program 99.8%
Taylor expanded in y around 0 80.7%
associate-/r*79.7%
div-inv79.7%
Applied egg-rr79.7%
un-div-inv79.7%
Applied egg-rr79.7%
Final simplification89.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -4.7e+48) (not (<= y 320000000000.0))) (- 1.0 (/ (/ x y) y)) (+ 1.0 (/ (/ x z) (- y t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.7e+48) || !(y <= 320000000000.0)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + ((x / z) / (y - t));
}
return tmp;
}
NOTE: x, y, 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 <= (-4.7d+48)) .or. (.not. (y <= 320000000000.0d0))) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 + ((x / z) / (y - t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.7e+48) || !(y <= 320000000000.0)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + ((x / z) / (y - t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -4.7e+48) or not (y <= 320000000000.0): tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 + ((x / z) / (y - t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -4.7e+48) || !(y <= 320000000000.0)) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -4.7e+48) || ~((y <= 320000000000.0)))
tmp = 1.0 - ((x / y) / y);
else
tmp = 1.0 + ((x / z) / (y - t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.7e+48], N[Not[LessEqual[y, 320000000000.0]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.7 \cdot 10^{+48} \lor \neg \left(y \leq 320000000000\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\end{array}
\end{array}
if y < -4.70000000000000012e48 or 3.2e11 < y Initial program 100.0%
Taylor expanded in t around 0 98.7%
div-inv98.7%
associate-/r*98.8%
Applied egg-rr98.8%
*-commutative98.8%
associate-*l/98.7%
associate-*r/98.7%
associate-*l/98.8%
*-lft-identity98.8%
Simplified98.8%
Taylor expanded in y around inf 97.1%
if -4.70000000000000012e48 < y < 3.2e11Initial program 97.9%
sub-neg97.9%
distribute-frac-neg97.9%
*-lft-identity97.9%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub-neg99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 87.0%
associate-/r*87.8%
Simplified87.8%
Final simplification91.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -1.25e-55) (not (<= y 1.05e-69))) (- 1.0 (/ x (* y (- y z)))) (+ 1.0 (/ (/ x z) (- y t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.25e-55) || !(y <= 1.05e-69)) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + ((x / z) / (y - t));
}
return tmp;
}
NOTE: x, y, 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.25d-55)) .or. (.not. (y <= 1.05d-69))) then
tmp = 1.0d0 - (x / (y * (y - z)))
else
tmp = 1.0d0 + ((x / z) / (y - t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.25e-55) || !(y <= 1.05e-69)) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + ((x / z) / (y - t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -1.25e-55) or not (y <= 1.05e-69): tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 + ((x / z) / (y - t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -1.25e-55) || !(y <= 1.05e-69)) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); else tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -1.25e-55) || ~((y <= 1.05e-69)))
tmp = 1.0 - (x / (y * (y - z)));
else
tmp = 1.0 + ((x / z) / (y - t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.25e-55], N[Not[LessEqual[y, 1.05e-69]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-55} \lor \neg \left(y \leq 1.05 \cdot 10^{-69}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\end{array}
\end{array}
if y < -1.25e-55 or 1.05e-69 < y Initial program 100.0%
Taylor expanded in t around 0 95.7%
if -1.25e-55 < y < 1.05e-69Initial program 97.0%
sub-neg97.0%
distribute-frac-neg97.0%
*-lft-identity97.0%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub-neg99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 89.4%
associate-/r*90.6%
Simplified90.6%
Final simplification93.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -1.18e-57)
(- 1.0 (/ (/ x (- y z)) y))
(if (<= y 4.05e-66)
(+ 1.0 (/ (/ x z) (- y t)))
(- 1.0 (/ x (* y (- y z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.18e-57) {
tmp = 1.0 - ((x / (y - z)) / y);
} else if (y <= 4.05e-66) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 - (x / (y * (y - z)));
}
return tmp;
}
NOTE: x, y, 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.18d-57)) then
tmp = 1.0d0 - ((x / (y - z)) / y)
else if (y <= 4.05d-66) then
tmp = 1.0d0 + ((x / z) / (y - t))
else
tmp = 1.0d0 - (x / (y * (y - z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.18e-57) {
tmp = 1.0 - ((x / (y - z)) / y);
} else if (y <= 4.05e-66) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 - (x / (y * (y - z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.18e-57: tmp = 1.0 - ((x / (y - z)) / y) elif y <= 4.05e-66: tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 - (x / (y * (y - z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.18e-57) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - z)) / y)); elseif (y <= 4.05e-66) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1.18e-57)
tmp = 1.0 - ((x / (y - z)) / y);
elseif (y <= 4.05e-66)
tmp = 1.0 + ((x / z) / (y - t));
else
tmp = 1.0 - (x / (y * (y - z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.18e-57], N[(1.0 - N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.05e-66], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.18 \cdot 10^{-57}:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\
\mathbf{elif}\;y \leq 4.05 \cdot 10^{-66}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -1.18e-57Initial program 100.0%
Taylor expanded in t around 0 95.2%
div-inv95.3%
associate-/r*95.3%
Applied egg-rr95.3%
*-commutative95.3%
associate-*l/95.2%
associate-*r/95.3%
associate-*l/95.3%
*-lft-identity95.3%
Simplified95.3%
if -1.18e-57 < y < 4.0500000000000002e-66Initial program 97.0%
sub-neg97.0%
distribute-frac-neg97.0%
*-lft-identity97.0%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub-neg99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 89.4%
associate-/r*90.6%
Simplified90.6%
if 4.0500000000000002e-66 < y Initial program 100.0%
Taylor expanded in t around 0 96.0%
Final simplification93.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -8.6e-19)
(- 1.0 (/ (/ x (- y z)) y))
(if (<= y 2.05e-73)
(- 1.0 (/ (/ x t) (- z y)))
(- 1.0 (/ x (* y (- y z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.6e-19) {
tmp = 1.0 - ((x / (y - z)) / y);
} else if (y <= 2.05e-73) {
tmp = 1.0 - ((x / t) / (z - y));
} else {
tmp = 1.0 - (x / (y * (y - z)));
}
return tmp;
}
NOTE: x, y, 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 <= (-8.6d-19)) then
tmp = 1.0d0 - ((x / (y - z)) / y)
else if (y <= 2.05d-73) then
tmp = 1.0d0 - ((x / t) / (z - y))
else
tmp = 1.0d0 - (x / (y * (y - z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.6e-19) {
tmp = 1.0 - ((x / (y - z)) / y);
} else if (y <= 2.05e-73) {
tmp = 1.0 - ((x / t) / (z - y));
} else {
tmp = 1.0 - (x / (y * (y - z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -8.6e-19: tmp = 1.0 - ((x / (y - z)) / y) elif y <= 2.05e-73: tmp = 1.0 - ((x / t) / (z - y)) else: tmp = 1.0 - (x / (y * (y - z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -8.6e-19) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - z)) / y)); elseif (y <= 2.05e-73) tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); else tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -8.6e-19)
tmp = 1.0 - ((x / (y - z)) / y);
elseif (y <= 2.05e-73)
tmp = 1.0 - ((x / t) / (z - y));
else
tmp = 1.0 - (x / (y * (y - z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -8.6e-19], N[(1.0 - N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e-73], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.6 \cdot 10^{-19}:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-73}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -8.6e-19Initial program 99.9%
Taylor expanded in t around 0 96.7%
div-inv96.7%
associate-/r*96.7%
Applied egg-rr96.7%
*-commutative96.7%
associate-*l/96.7%
associate-*r/96.7%
associate-*l/96.7%
*-lft-identity96.7%
Simplified96.7%
if -8.6e-19 < y < 2.05000000000000008e-73Initial program 97.2%
sub-neg97.2%
distribute-frac-neg97.2%
*-lft-identity97.2%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub-neg99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 86.4%
mul-1-neg86.4%
associate-/r*86.5%
Simplified86.5%
if 2.05000000000000008e-73 < y Initial program 100.0%
Taylor expanded in t around 0 95.0%
Final simplification91.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= t -7.4e-59) (not (<= t 4.4e-83))) (- 1.0 (/ x (* z t))) (+ 1.0 (/ x (* y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.4e-59) || !(t <= 4.4e-83)) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 + (x / (y * z));
}
return tmp;
}
NOTE: x, y, 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 <= (-7.4d-59)) .or. (.not. (t <= 4.4d-83))) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0 + (x / (y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.4e-59) || !(t <= 4.4e-83)) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 + (x / (y * z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (t <= -7.4e-59) or not (t <= 4.4e-83): tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 + (x / (y * z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((t <= -7.4e-59) || !(t <= 4.4e-83)) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = Float64(1.0 + Float64(x / Float64(y * z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((t <= -7.4e-59) || ~((t <= 4.4e-83)))
tmp = 1.0 - (x / (z * t));
else
tmp = 1.0 + (x / (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[t, -7.4e-59], N[Not[LessEqual[t, 4.4e-83]], $MachinePrecision]], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.4 \cdot 10^{-59} \lor \neg \left(t \leq 4.4 \cdot 10^{-83}\right):\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\end{array}
\end{array}
if t < -7.3999999999999998e-59 or 4.40000000000000015e-83 < t Initial program 99.9%
Taylor expanded in y around 0 82.7%
if -7.3999999999999998e-59 < t < 4.40000000000000015e-83Initial program 96.7%
sub-neg96.7%
distribute-frac-neg96.7%
*-lft-identity96.7%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub-neg99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 69.1%
associate-/r*70.3%
Simplified70.3%
Taylor expanded in y around inf 58.7%
*-commutative58.7%
Simplified58.7%
Final simplification74.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -3.4e-20) (not (<= y 7200000000.0))) (- 1.0 (/ (/ x y) y)) (- 1.0 (/ (/ x t) z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.4e-20) || !(y <= 7200000000.0)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
NOTE: x, y, 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 <= (-3.4d-20)) .or. (.not. (y <= 7200000000.0d0))) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 - ((x / t) / z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.4e-20) || !(y <= 7200000000.0)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -3.4e-20) or not (y <= 7200000000.0): tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 - ((x / t) / z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -3.4e-20) || !(y <= 7200000000.0)) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 - Float64(Float64(x / t) / z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -3.4e-20) || ~((y <= 7200000000.0)))
tmp = 1.0 - ((x / y) / y);
else
tmp = 1.0 - ((x / t) / z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.4e-20], N[Not[LessEqual[y, 7200000000.0]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-20} \lor \neg \left(y \leq 7200000000\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if y < -3.3999999999999997e-20 or 7.2e9 < y Initial program 100.0%
Taylor expanded in t around 0 98.0%
div-inv98.0%
associate-/r*98.1%
Applied egg-rr98.1%
*-commutative98.1%
associate-*l/98.0%
associate-*r/98.0%
associate-*l/98.0%
*-lft-identity98.0%
Simplified98.0%
Taylor expanded in y around inf 94.9%
if -3.3999999999999997e-20 < y < 7.2e9Initial program 97.7%
Taylor expanded in y around 0 79.2%
associate-/r*78.6%
div-inv78.6%
Applied egg-rr78.6%
un-div-inv78.6%
Applied egg-rr78.6%
Final simplification86.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -1.85e-60) (- 1.0 (/ x (* z t))) (if (<= t 5.5e-83) (+ 1.0 (/ x (* y z))) (- 1.0 (/ (/ x t) z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.85e-60) {
tmp = 1.0 - (x / (z * t));
} else if (t <= 5.5e-83) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
NOTE: x, y, 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.85d-60)) then
tmp = 1.0d0 - (x / (z * t))
else if (t <= 5.5d-83) then
tmp = 1.0d0 + (x / (y * z))
else
tmp = 1.0d0 - ((x / t) / z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.85e-60) {
tmp = 1.0 - (x / (z * t));
} else if (t <= 5.5e-83) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -1.85e-60: tmp = 1.0 - (x / (z * t)) elif t <= 5.5e-83: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 - ((x / t) / z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.85e-60) tmp = Float64(1.0 - Float64(x / Float64(z * t))); elseif (t <= 5.5e-83) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = Float64(1.0 - Float64(Float64(x / t) / z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -1.85e-60)
tmp = 1.0 - (x / (z * t));
elseif (t <= 5.5e-83)
tmp = 1.0 + (x / (y * z));
else
tmp = 1.0 - ((x / t) / z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -1.85e-60], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-83], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{-60}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-83}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if t < -1.85000000000000012e-60Initial program 100.0%
Taylor expanded in y around 0 83.2%
if -1.85000000000000012e-60 < t < 5.49999999999999964e-83Initial program 96.6%
sub-neg96.6%
distribute-frac-neg96.6%
*-lft-identity96.6%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub-neg99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 69.9%
associate-/r*71.1%
Simplified71.1%
Taylor expanded in y around inf 59.4%
*-commutative59.4%
Simplified59.4%
if 5.49999999999999964e-83 < t Initial program 99.9%
Taylor expanded in y around 0 81.2%
associate-/r*80.1%
div-inv80.1%
Applied egg-rr80.1%
un-div-inv80.1%
Applied egg-rr80.1%
Final simplification73.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (/ (/ x (- z y)) (- y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((x / (z - y)) / (y - t));
}
NOTE: x, y, 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 / (z - y)) / (y - t))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + ((x / (z - y)) / (y - t));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((x / (z - y)) / (y - t))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(Float64(x / Float64(z - y)) / Float64(y - t))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((x / (z - y)) / (y - t));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{\frac{x}{z - y}}{y - t}
\end{array}
Initial program 98.8%
sub-neg98.8%
distribute-frac-neg98.8%
*-lft-identity98.8%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Final simplification100.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 6e+63) (+ 1.0 (/ x (* y z))) (- 1.0 (/ x (* y t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6e+63) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0 - (x / (y * t));
}
return tmp;
}
NOTE: x, y, 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 <= 6d+63) then
tmp = 1.0d0 + (x / (y * z))
else
tmp = 1.0d0 - (x / (y * t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6e+63) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0 - (x / (y * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 6e+63: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 - (x / (y * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 6e+63) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = Float64(1.0 - Float64(x / Float64(y * t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 6e+63)
tmp = 1.0 + (x / (y * z));
else
tmp = 1.0 - (x / (y * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 6e+63], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6 \cdot 10^{+63}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if t < 5.99999999999999998e63Initial program 98.5%
sub-neg98.5%
distribute-frac-neg98.5%
*-lft-identity98.5%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 78.4%
associate-/r*78.9%
Simplified78.9%
Taylor expanded in y around inf 56.4%
*-commutative56.4%
Simplified56.4%
if 5.99999999999999998e63 < t Initial program 99.9%
Taylor expanded in z around 0 74.1%
Taylor expanded in y around 0 68.7%
associate-*r/68.7%
neg-mul-168.7%
Simplified68.7%
expm1-log1p-u66.5%
expm1-udef66.5%
add-sqr-sqrt45.7%
sqrt-unprod55.4%
sqr-neg55.4%
sqrt-unprod20.5%
add-sqr-sqrt66.1%
Applied egg-rr66.1%
expm1-def66.1%
expm1-log1p67.4%
Simplified67.4%
Final simplification58.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (/ x (* y z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (x / (y * z));
}
NOTE: x, y, 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 * z))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / (y * z));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (x / (y * z))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(y * z))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (x / (y * z));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{x}{y \cdot z}
\end{array}
Initial program 98.8%
sub-neg98.8%
distribute-frac-neg98.8%
*-lft-identity98.8%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 79.9%
associate-/r*80.3%
Simplified80.3%
Taylor expanded in y around inf 54.0%
*-commutative54.0%
Simplified54.0%
Final simplification54.0%
herbie shell --seed 2024010
(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)))))