
(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 (- 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.0%
sub-neg98.0%
distribute-frac-neg98.0%
*-lft-identity98.0%
associate-/r*98.4%
associate-*r/98.4%
metadata-eval98.4%
times-frac98.4%
neg-mul-198.4%
remove-double-neg98.4%
neg-mul-198.4%
sub-neg98.4%
distribute-neg-out98.4%
remove-double-neg98.4%
+-commutative98.4%
sub-neg98.4%
Simplified98.4%
Final simplification98.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 (or (<= z -1.05e-198) (not (<= z 5.8e-89))) (+ 1.0 (/ x (* z (- y t)))) (+ 1.0 (/ (/ x t) y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-198) || !(z <= 5.8e-89)) {
tmp = 1.0 + (x / (z * (y - t)));
} else {
tmp = 1.0 + ((x / t) / y);
}
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 ((z <= (-1.05d-198)) .or. (.not. (z <= 5.8d-89))) then
tmp = 1.0d0 + (x / (z * (y - t)))
else
tmp = 1.0d0 + ((x / t) / y)
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 ((z <= -1.05e-198) || !(z <= 5.8e-89)) {
tmp = 1.0 + (x / (z * (y - t)));
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.05e-198) or not (z <= 5.8e-89): tmp = 1.0 + (x / (z * (y - t))) else: tmp = 1.0 + ((x / t) / y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.05e-198) || !(z <= 5.8e-89)) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); else tmp = Float64(1.0 + Float64(Float64(x / t) / y)); 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 ((z <= -1.05e-198) || ~((z <= 5.8e-89)))
tmp = 1.0 + (x / (z * (y - t)));
else
tmp = 1.0 + ((x / t) / y);
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[z, -1.05e-198], N[Not[LessEqual[z, 5.8e-89]], $MachinePrecision]], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-198} \lor \neg \left(z \leq 5.8 \cdot 10^{-89}\right):\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.04999999999999996e-198 or 5.79999999999999984e-89 < z Initial program 98.9%
sub-neg98.9%
distribute-frac-neg98.9%
*-lft-identity98.9%
associate-/r*99.0%
associate-*r/99.0%
metadata-eval99.0%
times-frac99.0%
neg-mul-199.0%
remove-double-neg99.0%
neg-mul-199.0%
sub-neg99.0%
distribute-neg-out99.0%
remove-double-neg99.0%
+-commutative99.0%
sub-neg99.0%
Simplified99.0%
Taylor expanded in z around inf 86.4%
*-commutative86.4%
Simplified86.4%
if -1.04999999999999996e-198 < z < 5.79999999999999984e-89Initial program 95.1%
Taylor expanded in t around inf 63.9%
associate-*r/63.9%
neg-mul-163.9%
Simplified63.9%
Taylor expanded in y around inf 62.5%
mul-1-neg62.5%
associate-/r*64.1%
distribute-neg-frac64.1%
distribute-neg-frac64.1%
Simplified64.1%
Final simplification81.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -3.25e-198) (+ 1.0 (/ (/ x z) (- y t))) (if (<= z 8.2e-89) (+ 1.0 (/ (/ x t) 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 (z <= -3.25e-198) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 8.2e-89) {
tmp = 1.0 + ((x / t) / 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 (z <= (-3.25d-198)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= 8.2d-89) then
tmp = 1.0d0 + ((x / t) / 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 (z <= -3.25e-198) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 8.2e-89) {
tmp = 1.0 + ((x / t) / 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 z <= -3.25e-198: tmp = 1.0 + ((x / z) / (y - t)) elif z <= 8.2e-89: tmp = 1.0 + ((x / t) / 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 (z <= -3.25e-198) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 8.2e-89) tmp = Float64(1.0 + Float64(Float64(x / t) / y)); else tmp = Float64(1.0 + Float64(x / Float64(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 (z <= -3.25e-198)
tmp = 1.0 + ((x / z) / (y - t));
elseif (z <= 8.2e-89)
tmp = 1.0 + ((x / t) / 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[LessEqual[z, -3.25e-198], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e-89], N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.25 \cdot 10^{-198}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-89}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if z < -3.2500000000000002e-198Initial program 98.9%
sub-neg98.9%
distribute-frac-neg98.9%
*-lft-identity98.9%
associate-/r*99.2%
associate-*r/99.2%
metadata-eval99.2%
times-frac99.2%
neg-mul-199.2%
remove-double-neg99.2%
neg-mul-199.2%
sub-neg99.2%
distribute-neg-out99.2%
remove-double-neg99.2%
+-commutative99.2%
sub-neg99.2%
Simplified99.2%
Taylor expanded in z around inf 83.3%
associate-/r*83.5%
Simplified83.5%
if -3.2500000000000002e-198 < z < 8.1999999999999997e-89Initial program 95.1%
Taylor expanded in t around inf 63.9%
associate-*r/63.9%
neg-mul-163.9%
Simplified63.9%
Taylor expanded in y around inf 62.5%
mul-1-neg62.5%
associate-/r*64.1%
distribute-neg-frac64.1%
distribute-neg-frac64.1%
Simplified64.1%
if 8.1999999999999997e-89 < z Initial program 99.0%
sub-neg99.0%
distribute-frac-neg99.0%
*-lft-identity99.0%
associate-/r*98.7%
associate-*r/98.7%
metadata-eval98.7%
times-frac98.7%
neg-mul-198.7%
remove-double-neg98.7%
neg-mul-198.7%
sub-neg98.7%
distribute-neg-out98.7%
remove-double-neg98.7%
+-commutative98.7%
sub-neg98.7%
Simplified98.7%
Taylor expanded in z around inf 91.4%
*-commutative91.4%
Simplified91.4%
Final simplification81.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 (<= z -9e-44) (+ 1.0 (/ (/ x z) (- y t))) (if (<= z 1.72e+37) (- 1.0 (/ x (* y (- y t)))) (- 1.0 (/ x (* z t))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9e-44) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 1.72e+37) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - (x / (z * 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 (z <= (-9d-44)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= 1.72d+37) then
tmp = 1.0d0 - (x / (y * (y - t)))
else
tmp = 1.0d0 - (x / (z * 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 (z <= -9e-44) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 1.72e+37) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -9e-44: tmp = 1.0 + ((x / z) / (y - t)) elif z <= 1.72e+37: tmp = 1.0 - (x / (y * (y - t))) else: tmp = 1.0 - (x / (z * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -9e-44) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 1.72e+37) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); else tmp = Float64(1.0 - Float64(x / Float64(z * 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 (z <= -9e-44)
tmp = 1.0 + ((x / z) / (y - t));
elseif (z <= 1.72e+37)
tmp = 1.0 - (x / (y * (y - t)));
else
tmp = 1.0 - (x / (z * 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[z, -9e-44], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.72e+37], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-44}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 1.72 \cdot 10^{+37}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if z < -8.9999999999999997e-44Initial program 99.2%
sub-neg99.2%
distribute-frac-neg99.2%
*-lft-identity99.2%
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.8%
associate-/r*97.6%
Simplified97.6%
if -8.9999999999999997e-44 < z < 1.72000000000000002e37Initial program 96.6%
Taylor expanded in z around 0 82.4%
if 1.72000000000000002e37 < z Initial program 99.9%
Taylor expanded in y around 0 85.5%
Final simplification87.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -1.25e-43) (+ 1.0 (/ (/ x z) (- y t))) (if (<= z 1.9e+38) (- 1.0 (/ (/ x y) (- y t))) (- 1.0 (/ x (* z t))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.25e-43) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 1.9e+38) {
tmp = 1.0 - ((x / y) / (y - t));
} else {
tmp = 1.0 - (x / (z * 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 (z <= (-1.25d-43)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= 1.9d+38) then
tmp = 1.0d0 - ((x / y) / (y - t))
else
tmp = 1.0d0 - (x / (z * 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 (z <= -1.25e-43) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 1.9e+38) {
tmp = 1.0 - ((x / y) / (y - t));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.25e-43: tmp = 1.0 + ((x / z) / (y - t)) elif z <= 1.9e+38: tmp = 1.0 - ((x / y) / (y - t)) else: tmp = 1.0 - (x / (z * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.25e-43) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 1.9e+38) tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - t))); else tmp = Float64(1.0 - Float64(x / Float64(z * 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 (z <= -1.25e-43)
tmp = 1.0 + ((x / z) / (y - t));
elseif (z <= 1.9e+38)
tmp = 1.0 - ((x / y) / (y - t));
else
tmp = 1.0 - (x / (z * 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[z, -1.25e-43], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+38], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-43}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+38}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if z < -1.25000000000000005e-43Initial program 99.2%
sub-neg99.2%
distribute-frac-neg99.2%
*-lft-identity99.2%
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.8%
associate-/r*97.6%
Simplified97.6%
if -1.25000000000000005e-43 < z < 1.8999999999999999e38Initial program 96.6%
clear-num96.6%
inv-pow96.6%
*-commutative96.6%
associate-/l*96.8%
Applied egg-rr96.8%
unpow-196.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 82.4%
associate-/r*83.2%
Simplified83.2%
if 1.8999999999999999e38 < z Initial program 99.9%
Taylor expanded in y around 0 85.5%
Final simplification88.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 (<= z -2.3e-43)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= z 9.6e-143)
(- 1.0 (/ (/ x y) (- y t)))
(+ 1.0 (/ x (* t (- y z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.3e-43) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 9.6e-143) {
tmp = 1.0 - ((x / y) / (y - t));
} else {
tmp = 1.0 + (x / (t * (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 (z <= (-2.3d-43)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= 9.6d-143) then
tmp = 1.0d0 - ((x / y) / (y - t))
else
tmp = 1.0d0 + (x / (t * (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 (z <= -2.3e-43) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 9.6e-143) {
tmp = 1.0 - ((x / y) / (y - t));
} else {
tmp = 1.0 + (x / (t * (y - z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -2.3e-43: tmp = 1.0 + ((x / z) / (y - t)) elif z <= 9.6e-143: tmp = 1.0 - ((x / y) / (y - t)) else: tmp = 1.0 + (x / (t * (y - z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2.3e-43) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 9.6e-143) tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - t))); else tmp = Float64(1.0 + Float64(x / Float64(t * 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 (z <= -2.3e-43)
tmp = 1.0 + ((x / z) / (y - t));
elseif (z <= 9.6e-143)
tmp = 1.0 - ((x / y) / (y - t));
else
tmp = 1.0 + (x / (t * (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[z, -2.3e-43], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.6e-143], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(t * 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}\;z \leq -2.3 \cdot 10^{-43}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-143}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if z < -2.2999999999999999e-43Initial program 99.2%
sub-neg99.2%
distribute-frac-neg99.2%
*-lft-identity99.2%
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.8%
associate-/r*97.6%
Simplified97.6%
if -2.2999999999999999e-43 < z < 9.5999999999999995e-143Initial program 96.1%
clear-num96.1%
inv-pow96.1%
*-commutative96.1%
associate-/l*96.7%
Applied egg-rr96.7%
unpow-196.7%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around 0 84.1%
associate-/r*85.1%
Simplified85.1%
if 9.5999999999999995e-143 < z Initial program 99.0%
Taylor expanded in t around inf 79.9%
associate-*r/79.9%
neg-mul-179.9%
Simplified79.9%
Final simplification87.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 (or (<= y -7.2e-5) (not (<= y 510000000.0))) (+ 1.0 (/ x (* z y))) (- 1.0 (/ x (* z t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.2e-5) || !(y <= 510000000.0)) {
tmp = 1.0 + (x / (z * y));
} else {
tmp = 1.0 - (x / (z * 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 <= (-7.2d-5)) .or. (.not. (y <= 510000000.0d0))) then
tmp = 1.0d0 + (x / (z * y))
else
tmp = 1.0d0 - (x / (z * 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 <= -7.2e-5) || !(y <= 510000000.0)) {
tmp = 1.0 + (x / (z * y));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -7.2e-5) or not (y <= 510000000.0): tmp = 1.0 + (x / (z * y)) else: tmp = 1.0 - (x / (z * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -7.2e-5) || !(y <= 510000000.0)) tmp = Float64(1.0 + Float64(x / Float64(z * y))); else tmp = Float64(1.0 - Float64(x / Float64(z * 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 <= -7.2e-5) || ~((y <= 510000000.0)))
tmp = 1.0 + (x / (z * y));
else
tmp = 1.0 - (x / (z * 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, -7.2e-5], N[Not[LessEqual[y, 510000000.0]], $MachinePrecision]], N[(1.0 + N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-5} \lor \neg \left(y \leq 510000000\right):\\
\;\;\;\;1 + \frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -7.20000000000000018e-5 or 5.1e8 < y Initial program 100.0%
sub-neg100.0%
distribute-frac-neg100.0%
*-lft-identity100.0%
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 71.5%
associate-/r*71.4%
Simplified71.4%
Taylor expanded in y around inf 66.0%
*-commutative66.0%
Simplified66.0%
if -7.20000000000000018e-5 < y < 5.1e8Initial program 95.9%
Taylor expanded in y around 0 73.1%
Final simplification69.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 (<= y -7.7e+71) (- 1.0 (/ x (* y t))) (if (<= y 510000000.0) (- 1.0 (/ x (* z t))) (+ 1.0 (/ x (* z y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.7e+71) {
tmp = 1.0 - (x / (y * t));
} else if (y <= 510000000.0) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 + (x / (z * y));
}
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 <= (-7.7d+71)) then
tmp = 1.0d0 - (x / (y * t))
else if (y <= 510000000.0d0) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0 + (x / (z * y))
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 <= -7.7e+71) {
tmp = 1.0 - (x / (y * t));
} else if (y <= 510000000.0) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 + (x / (z * y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -7.7e+71: tmp = 1.0 - (x / (y * t)) elif y <= 510000000.0: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 + (x / (z * y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -7.7e+71) tmp = Float64(1.0 - Float64(x / Float64(y * t))); elseif (y <= 510000000.0) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = Float64(1.0 + Float64(x / Float64(z * y))); 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 <= -7.7e+71)
tmp = 1.0 - (x / (y * t));
elseif (y <= 510000000.0)
tmp = 1.0 - (x / (z * t));
else
tmp = 1.0 + (x / (z * y));
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, -7.7e+71], N[(1.0 - N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 510000000.0], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.7 \cdot 10^{+71}:\\
\;\;\;\;1 - \frac{x}{y \cdot t}\\
\mathbf{elif}\;y \leq 510000000:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{z \cdot y}\\
\end{array}
\end{array}
if y < -7.70000000000000018e71Initial program 100.0%
Taylor expanded in t around inf 64.4%
associate-*r/64.4%
neg-mul-164.4%
Simplified64.4%
Taylor expanded in y around inf 63.9%
mul-1-neg63.9%
associate-/r*63.7%
distribute-neg-frac63.7%
distribute-neg-frac63.7%
Simplified63.7%
add063.7%
associate-/l/63.9%
add-sqr-sqrt22.2%
sqrt-unprod50.0%
sqr-neg50.0%
sqrt-unprod41.7%
add-sqr-sqrt63.8%
Applied egg-rr63.8%
add063.8%
Simplified63.8%
if -7.70000000000000018e71 < y < 5.1e8Initial program 96.4%
Taylor expanded in y around 0 70.4%
if 5.1e8 < y Initial program 100.0%
sub-neg100.0%
distribute-frac-neg100.0%
*-lft-identity100.0%
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.2%
associate-/r*79.1%
Simplified79.1%
Taylor expanded in y around inf 74.2%
*-commutative74.2%
Simplified74.2%
Final simplification70.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 (<= y -8.5e+71) (- 1.0 (/ x (* y t))) (if (<= y 3500000000.0) (- 1.0 (/ (/ x z) t)) (+ 1.0 (/ x (* z y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.5e+71) {
tmp = 1.0 - (x / (y * t));
} else if (y <= 3500000000.0) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0 + (x / (z * y));
}
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.5d+71)) then
tmp = 1.0d0 - (x / (y * t))
else if (y <= 3500000000.0d0) then
tmp = 1.0d0 - ((x / z) / t)
else
tmp = 1.0d0 + (x / (z * y))
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.5e+71) {
tmp = 1.0 - (x / (y * t));
} else if (y <= 3500000000.0) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0 + (x / (z * y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -8.5e+71: tmp = 1.0 - (x / (y * t)) elif y <= 3500000000.0: tmp = 1.0 - ((x / z) / t) else: tmp = 1.0 + (x / (z * y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -8.5e+71) tmp = Float64(1.0 - Float64(x / Float64(y * t))); elseif (y <= 3500000000.0) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); else tmp = Float64(1.0 + Float64(x / Float64(z * y))); 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.5e+71)
tmp = 1.0 - (x / (y * t));
elseif (y <= 3500000000.0)
tmp = 1.0 - ((x / z) / t);
else
tmp = 1.0 + (x / (z * y));
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.5e+71], N[(1.0 - N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3500000000.0], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+71}:\\
\;\;\;\;1 - \frac{x}{y \cdot t}\\
\mathbf{elif}\;y \leq 3500000000:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{z \cdot y}\\
\end{array}
\end{array}
if y < -8.4999999999999996e71Initial program 100.0%
Taylor expanded in t around inf 64.4%
associate-*r/64.4%
neg-mul-164.4%
Simplified64.4%
Taylor expanded in y around inf 63.9%
mul-1-neg63.9%
associate-/r*63.7%
distribute-neg-frac63.7%
distribute-neg-frac63.7%
Simplified63.7%
add063.7%
associate-/l/63.9%
add-sqr-sqrt22.2%
sqrt-unprod50.0%
sqr-neg50.0%
sqrt-unprod41.7%
add-sqr-sqrt63.8%
Applied egg-rr63.8%
add063.8%
Simplified63.8%
if -8.4999999999999996e71 < y < 3.5e9Initial program 96.4%
clear-num96.4%
inv-pow96.4%
*-commutative96.4%
associate-/l*97.1%
Applied egg-rr97.1%
unpow-197.1%
associate-/r/98.0%
Simplified98.0%
Taylor expanded in y around 0 70.4%
*-lft-identity70.4%
times-frac69.1%
associate-*l/69.1%
*-lft-identity69.1%
Simplified69.1%
if 3.5e9 < y Initial program 100.0%
sub-neg100.0%
distribute-frac-neg100.0%
*-lft-identity100.0%
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.2%
associate-/r*79.1%
Simplified79.1%
Taylor expanded in y around inf 74.2%
*-commutative74.2%
Simplified74.2%
Final simplification69.3%
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 -2.2e+70) (+ 1.0 (/ x (* y t))) (if (<= y 26000000000.0) (- 1.0 (/ (/ x z) t)) (+ 1.0 (/ x (* z y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.2e+70) {
tmp = 1.0 + (x / (y * t));
} else if (y <= 26000000000.0) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0 + (x / (z * y));
}
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 <= (-2.2d+70)) then
tmp = 1.0d0 + (x / (y * t))
else if (y <= 26000000000.0d0) then
tmp = 1.0d0 - ((x / z) / t)
else
tmp = 1.0d0 + (x / (z * y))
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 <= -2.2e+70) {
tmp = 1.0 + (x / (y * t));
} else if (y <= 26000000000.0) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0 + (x / (z * y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -2.2e+70: tmp = 1.0 + (x / (y * t)) elif y <= 26000000000.0: tmp = 1.0 - ((x / z) / t) else: tmp = 1.0 + (x / (z * y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.2e+70) tmp = Float64(1.0 + Float64(x / Float64(y * t))); elseif (y <= 26000000000.0) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); else tmp = Float64(1.0 + Float64(x / Float64(z * y))); 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 <= -2.2e+70)
tmp = 1.0 + (x / (y * t));
elseif (y <= 26000000000.0)
tmp = 1.0 - ((x / z) / t);
else
tmp = 1.0 + (x / (z * y));
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, -2.2e+70], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 26000000000.0], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+70}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{elif}\;y \leq 26000000000:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{z \cdot y}\\
\end{array}
\end{array}
if y < -2.20000000000000001e70Initial program 100.0%
Taylor expanded in t around inf 63.9%
associate-*r/63.9%
neg-mul-163.9%
Simplified63.9%
Taylor expanded in y around inf 63.4%
mul-1-neg63.4%
Simplified63.4%
if -2.20000000000000001e70 < y < 2.6e10Initial program 96.3%
clear-num96.3%
inv-pow96.3%
*-commutative96.3%
associate-/l*97.0%
Applied egg-rr97.0%
unpow-197.0%
associate-/r/98.0%
Simplified98.0%
Taylor expanded in y around 0 71.4%
*-lft-identity71.4%
times-frac70.0%
associate-*l/70.1%
*-lft-identity70.1%
Simplified70.1%
if 2.6e10 < y Initial program 100.0%
sub-neg100.0%
distribute-frac-neg100.0%
*-lft-identity100.0%
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.2%
associate-/r*79.1%
Simplified79.1%
Taylor expanded in y around inf 74.2%
*-commutative74.2%
Simplified74.2%
Final simplification69.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))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (x / (z * y));
}
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))
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));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (x / (z * y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(z * y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (x / (z * y));
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[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{x}{z \cdot y}
\end{array}
Initial program 98.0%
sub-neg98.0%
distribute-frac-neg98.0%
*-lft-identity98.0%
associate-/r*98.4%
associate-*r/98.4%
metadata-eval98.4%
times-frac98.4%
neg-mul-198.4%
remove-double-neg98.4%
neg-mul-198.4%
sub-neg98.4%
distribute-neg-out98.4%
remove-double-neg98.4%
+-commutative98.4%
sub-neg98.4%
Simplified98.4%
Taylor expanded in z around inf 76.1%
associate-/r*76.1%
Simplified76.1%
Taylor expanded in y around inf 55.1%
*-commutative55.1%
Simplified55.1%
Final simplification55.1%
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(Float64(x / 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[(N[(x / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{\frac{x}{y}}{z}
\end{array}
Initial program 98.0%
sub-neg98.0%
distribute-frac-neg98.0%
*-lft-identity98.0%
associate-/r*98.4%
associate-*r/98.4%
metadata-eval98.4%
times-frac98.4%
neg-mul-198.4%
remove-double-neg98.4%
neg-mul-198.4%
sub-neg98.4%
distribute-neg-out98.4%
remove-double-neg98.4%
+-commutative98.4%
sub-neg98.4%
Simplified98.4%
Taylor expanded in z around inf 76.1%
associate-/r*76.1%
Simplified76.1%
clear-num76.1%
inv-pow76.1%
div-inv76.1%
clear-num76.3%
Applied egg-rr76.3%
unpow-176.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in y around inf 55.1%
associate-/r*55.6%
Simplified55.6%
Final simplification55.6%
herbie shell --seed 2024034
(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)))))