
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
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 = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
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 = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ y z) (/ t (+ z -1.0)))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+255)))
(/ y (/ z x))
(* t_1 x))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (z + -1.0));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+255)) {
tmp = y / (z / x);
} else {
tmp = t_1 * x;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (z + -1.0));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+255)) {
tmp = y / (z / x);
} else {
tmp = t_1 * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) + (t / (z + -1.0)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+255): tmp = y / (z / x) else: tmp = t_1 * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) + Float64(t / Float64(z + -1.0))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+255)) tmp = Float64(y / Float64(z / x)); else tmp = Float64(t_1 * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) + (t / (z + -1.0)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+255))) tmp = y / (z / x); else tmp = t_1 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+255]], $MachinePrecision]], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} + \frac{t}{z + -1}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+255}\right):\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot x\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0 or 9.99999999999999988e254 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 56.8%
Taylor expanded in y around inf 99.8%
associate-*r/99.8%
associate-*r*99.8%
neg-mul-199.8%
*-commutative99.8%
times-frac99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
neg-sub099.8%
associate--r-99.8%
metadata-eval99.8%
Simplified99.8%
add-cube-cbrt99.0%
pow398.9%
fma-define98.9%
+-commutative98.9%
Applied egg-rr98.9%
Taylor expanded in y around inf 99.7%
associate-*r/56.8%
*-commutative56.8%
associate-/r/100.0%
Simplified100.0%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 9.99999999999999988e254Initial program 97.0%
Final simplification97.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -13500000000.0) (not (<= z 1.0))) (* x (+ (/ y z) (/ t z))) (* x (- (/ y z) (+ t (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -13500000000.0) || !(z <= 1.0)) {
tmp = x * ((y / z) + (t / z));
} else {
tmp = x * ((y / z) - (t + (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-13500000000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((y / z) + (t / z))
else
tmp = x * ((y / z) - (t + (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -13500000000.0) || !(z <= 1.0)) {
tmp = x * ((y / z) + (t / z));
} else {
tmp = x * ((y / z) - (t + (z * t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -13500000000.0) or not (z <= 1.0): tmp = x * ((y / z) + (t / z)) else: tmp = x * ((y / z) - (t + (z * t))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -13500000000.0) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z))); else tmp = Float64(x * Float64(Float64(y / z) - Float64(t + Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -13500000000.0) || ~((z <= 1.0))) tmp = x * ((y / z) + (t / z)); else tmp = x * ((y / z) - (t + (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -13500000000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - N[(t + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -13500000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - \left(t + z \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -1.35e10 or 1 < z Initial program 95.4%
Taylor expanded in z around inf 95.2%
associate-*r/95.2%
neg-mul-195.2%
Simplified95.2%
sub-neg95.2%
distribute-frac-neg95.2%
remove-double-neg95.2%
Applied egg-rr95.2%
if -1.35e10 < z < 1Initial program 86.2%
Taylor expanded in z around 0 85.1%
Final simplification90.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -13500000000.0) (not (<= z 1.0))) (* x (+ (/ y z) (/ t z))) (* x (/ (- y (* z t)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -13500000000.0) || !(z <= 1.0)) {
tmp = x * ((y / z) + (t / z));
} else {
tmp = x * ((y - (z * t)) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-13500000000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((y / z) + (t / z))
else
tmp = x * ((y - (z * t)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -13500000000.0) || !(z <= 1.0)) {
tmp = x * ((y / z) + (t / z));
} else {
tmp = x * ((y - (z * t)) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -13500000000.0) or not (z <= 1.0): tmp = x * ((y / z) + (t / z)) else: tmp = x * ((y - (z * t)) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -13500000000.0) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z))); else tmp = Float64(x * Float64(Float64(y - Float64(z * t)) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -13500000000.0) || ~((z <= 1.0))) tmp = x * ((y / z) + (t / z)); else tmp = x * ((y - (z * t)) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -13500000000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -13500000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z \cdot t}{z}\\
\end{array}
\end{array}
if z < -1.35e10 or 1 < z Initial program 95.4%
Taylor expanded in z around inf 95.2%
associate-*r/95.2%
neg-mul-195.2%
Simplified95.2%
sub-neg95.2%
distribute-frac-neg95.2%
remove-double-neg95.2%
Applied egg-rr95.2%
if -1.35e10 < z < 1Initial program 86.2%
Taylor expanded in z around 0 84.1%
mul-1-neg84.1%
unsub-neg84.1%
Simplified84.1%
Final simplification90.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -13500000000.0) (not (<= z 1.0))) (* x (+ (/ y z) (/ t z))) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -13500000000.0) || !(z <= 1.0)) {
tmp = x * ((y / z) + (t / z));
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-13500000000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((y / z) + (t / z))
else
tmp = x * ((y / z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -13500000000.0) || !(z <= 1.0)) {
tmp = x * ((y / z) + (t / z));
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -13500000000.0) or not (z <= 1.0): tmp = x * ((y / z) + (t / z)) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -13500000000.0) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z))); else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -13500000000.0) || ~((z <= 1.0))) tmp = x * ((y / z) + (t / z)); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -13500000000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -13500000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -1.35e10 or 1 < z Initial program 95.4%
Taylor expanded in z around inf 95.2%
associate-*r/95.2%
neg-mul-195.2%
Simplified95.2%
sub-neg95.2%
distribute-frac-neg95.2%
remove-double-neg95.2%
Applied egg-rr95.2%
if -1.35e10 < z < 1Initial program 86.2%
Taylor expanded in z around 0 84.1%
Final simplification90.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -13500000000.0) (not (<= z 1.0))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -13500000000.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-13500000000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((y + t) / z)
else
tmp = x * ((y / z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -13500000000.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -13500000000.0) or not (z <= 1.0): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -13500000000.0) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(y + t) / z)); else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -13500000000.0) || ~((z <= 1.0))) tmp = x * ((y + t) / z); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -13500000000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -13500000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -1.35e10 or 1 < z Initial program 95.4%
Taylor expanded in z around inf 89.5%
associate-/l*95.2%
sub-neg95.2%
remove-double-neg95.2%
neg-mul-195.2%
distribute-rgt-neg-in95.2%
distribute-lft-in95.2%
neg-mul-195.2%
sub-neg95.2%
*-commutative95.2%
associate-*l/95.2%
*-commutative95.2%
associate-*r/95.2%
sub-neg95.2%
neg-mul-195.2%
distribute-lft-in95.2%
neg-mul-195.2%
remove-double-neg95.2%
neg-mul-195.2%
remove-double-neg95.2%
+-commutative95.2%
Simplified95.2%
if -1.35e10 < z < 1Initial program 86.2%
Taylor expanded in z around 0 84.1%
Final simplification90.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.2e+43) (not (<= t 8.5e+131))) (* x (/ t (+ z -1.0))) (/ (* y x) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.2e+43) || !(t <= 8.5e+131)) {
tmp = x * (t / (z + -1.0));
} else {
tmp = (y * x) / z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-4.2d+43)) .or. (.not. (t <= 8.5d+131))) then
tmp = x * (t / (z + (-1.0d0)))
else
tmp = (y * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.2e+43) || !(t <= 8.5e+131)) {
tmp = x * (t / (z + -1.0));
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.2e+43) or not (t <= 8.5e+131): tmp = x * (t / (z + -1.0)) else: tmp = (y * x) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.2e+43) || !(t <= 8.5e+131)) tmp = Float64(x * Float64(t / Float64(z + -1.0))); else tmp = Float64(Float64(y * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.2e+43) || ~((t <= 8.5e+131))) tmp = x * (t / (z + -1.0)); else tmp = (y * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.2e+43], N[Not[LessEqual[t, 8.5e+131]], $MachinePrecision]], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+43} \lor \neg \left(t \leq 8.5 \cdot 10^{+131}\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if t < -4.20000000000000003e43 or 8.50000000000000063e131 < t Initial program 94.5%
Taylor expanded in y around 0 76.5%
mul-1-neg76.5%
distribute-neg-frac276.5%
neg-sub076.5%
associate--r-76.5%
metadata-eval76.5%
Simplified76.5%
if -4.20000000000000003e43 < t < 8.50000000000000063e131Initial program 89.4%
Taylor expanded in y around inf 77.9%
Final simplification77.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9e+40) (not (<= t 6.2e+138))) (* t (/ x (+ z -1.0))) (/ (* y x) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9e+40) || !(t <= 6.2e+138)) {
tmp = t * (x / (z + -1.0));
} else {
tmp = (y * x) / z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-9d+40)) .or. (.not. (t <= 6.2d+138))) then
tmp = t * (x / (z + (-1.0d0)))
else
tmp = (y * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9e+40) || !(t <= 6.2e+138)) {
tmp = t * (x / (z + -1.0));
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9e+40) or not (t <= 6.2e+138): tmp = t * (x / (z + -1.0)) else: tmp = (y * x) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9e+40) || !(t <= 6.2e+138)) tmp = Float64(t * Float64(x / Float64(z + -1.0))); else tmp = Float64(Float64(y * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -9e+40) || ~((t <= 6.2e+138))) tmp = t * (x / (z + -1.0)); else tmp = (y * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9e+40], N[Not[LessEqual[t, 6.2e+138]], $MachinePrecision]], N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+40} \lor \neg \left(t \leq 6.2 \cdot 10^{+138}\right):\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if t < -9.00000000000000064e40 or 6.1999999999999995e138 < t Initial program 94.3%
Taylor expanded in y around 0 68.6%
mul-1-neg68.6%
associate-/l*74.9%
distribute-rgt-neg-in74.9%
distribute-neg-frac274.9%
neg-sub074.9%
associate--r-74.9%
metadata-eval74.9%
Simplified74.9%
if -9.00000000000000064e40 < t < 6.1999999999999995e138Initial program 89.6%
Taylor expanded in y around inf 77.2%
Final simplification76.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9e+106) (not (<= t 5.2e+132))) (* x (/ t z)) (/ (* y x) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9e+106) || !(t <= 5.2e+132)) {
tmp = x * (t / z);
} else {
tmp = (y * x) / z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-9d+106)) .or. (.not. (t <= 5.2d+132))) then
tmp = x * (t / z)
else
tmp = (y * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9e+106) || !(t <= 5.2e+132)) {
tmp = x * (t / z);
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9e+106) or not (t <= 5.2e+132): tmp = x * (t / z) else: tmp = (y * x) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9e+106) || !(t <= 5.2e+132)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(Float64(y * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -9e+106) || ~((t <= 5.2e+132))) tmp = x * (t / z); else tmp = (y * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9e+106], N[Not[LessEqual[t, 5.2e+132]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+106} \lor \neg \left(t \leq 5.2 \cdot 10^{+132}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if t < -8.9999999999999994e106 or 5.2e132 < t Initial program 93.9%
Taylor expanded in y around 0 76.5%
mul-1-neg76.5%
distribute-neg-frac276.5%
neg-sub076.5%
associate--r-76.5%
metadata-eval76.5%
Simplified76.5%
Taylor expanded in z around inf 65.7%
if -8.9999999999999994e106 < t < 5.2e132Initial program 89.9%
Taylor expanded in y around inf 76.1%
Final simplification72.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.2e+106) (not (<= t 1.9e+134))) (* x (/ t z)) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.2e+106) || !(t <= 1.9e+134)) {
tmp = x * (t / z);
} else {
tmp = x / (z / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-3.2d+106)) .or. (.not. (t <= 1.9d+134))) then
tmp = x * (t / z)
else
tmp = x / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.2e+106) || !(t <= 1.9e+134)) {
tmp = x * (t / z);
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.2e+106) or not (t <= 1.9e+134): tmp = x * (t / z) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.2e+106) || !(t <= 1.9e+134)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.2e+106) || ~((t <= 1.9e+134))) tmp = x * (t / z); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.2e+106], N[Not[LessEqual[t, 1.9e+134]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+106} \lor \neg \left(t \leq 1.9 \cdot 10^{+134}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -3.1999999999999998e106 or 1.89999999999999999e134 < t Initial program 93.9%
Taylor expanded in y around 0 76.5%
mul-1-neg76.5%
distribute-neg-frac276.5%
neg-sub076.5%
associate--r-76.5%
metadata-eval76.5%
Simplified76.5%
Taylor expanded in z around inf 65.7%
if -3.1999999999999998e106 < t < 1.89999999999999999e134Initial program 89.9%
Taylor expanded in y around inf 76.1%
associate-*r/71.7%
Simplified71.7%
clear-num71.6%
un-div-inv72.0%
Applied egg-rr72.0%
Final simplification70.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.6e+106) (not (<= t 6.5e+135))) (* x (/ t z)) (* (/ y z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.6e+106) || !(t <= 6.5e+135)) {
tmp = x * (t / z);
} else {
tmp = (y / z) * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-4.6d+106)) .or. (.not. (t <= 6.5d+135))) then
tmp = x * (t / z)
else
tmp = (y / z) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.6e+106) || !(t <= 6.5e+135)) {
tmp = x * (t / z);
} else {
tmp = (y / z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.6e+106) or not (t <= 6.5e+135): tmp = x * (t / z) else: tmp = (y / z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.6e+106) || !(t <= 6.5e+135)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(Float64(y / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.6e+106) || ~((t <= 6.5e+135))) tmp = x * (t / z); else tmp = (y / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.6e+106], N[Not[LessEqual[t, 6.5e+135]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{+106} \lor \neg \left(t \leq 6.5 \cdot 10^{+135}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}
\end{array}
if t < -4.6000000000000004e106 or 6.5000000000000003e135 < t Initial program 93.9%
Taylor expanded in y around 0 76.5%
mul-1-neg76.5%
distribute-neg-frac276.5%
neg-sub076.5%
associate--r-76.5%
metadata-eval76.5%
Simplified76.5%
Taylor expanded in z around inf 65.7%
if -4.6000000000000004e106 < t < 6.5000000000000003e135Initial program 89.9%
Taylor expanded in y around inf 76.1%
associate-*r/71.7%
Simplified71.7%
Final simplification69.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -13500000000.0) (not (<= z 1.5e-9))) (* t (/ x z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -13500000000.0) || !(z <= 1.5e-9)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-13500000000.0d0)) .or. (.not. (z <= 1.5d-9))) then
tmp = t * (x / z)
else
tmp = t * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -13500000000.0) || !(z <= 1.5e-9)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -13500000000.0) or not (z <= 1.5e-9): tmp = t * (x / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -13500000000.0) || !(z <= 1.5e-9)) tmp = Float64(t * Float64(x / z)); else tmp = Float64(t * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -13500000000.0) || ~((z <= 1.5e-9))) tmp = t * (x / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -13500000000.0], N[Not[LessEqual[z, 1.5e-9]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -13500000000 \lor \neg \left(z \leq 1.5 \cdot 10^{-9}\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -1.35e10 or 1.49999999999999999e-9 < z Initial program 95.5%
Taylor expanded in y around 0 57.2%
mul-1-neg57.2%
distribute-neg-frac257.2%
neg-sub057.2%
associate--r-57.2%
metadata-eval57.2%
Simplified57.2%
Taylor expanded in z around inf 53.0%
associate-/l*56.0%
Simplified56.0%
if -1.35e10 < z < 1.49999999999999999e-9Initial program 85.7%
Taylor expanded in y around 0 32.3%
mul-1-neg32.3%
distribute-neg-frac232.3%
neg-sub032.3%
associate--r-32.3%
metadata-eval32.3%
Simplified32.3%
Taylor expanded in z around 0 31.2%
neg-mul-131.2%
*-commutative31.2%
distribute-rgt-neg-in31.2%
Simplified31.2%
Final simplification45.1%
(FPCore (x y z t) :precision binary64 (if (<= z -13500000000.0) (* t (/ x z)) (if (<= z 1.5e-9) (* t (- x)) (* x (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -13500000000.0) {
tmp = t * (x / z);
} else if (z <= 1.5e-9) {
tmp = t * -x;
} else {
tmp = x * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-13500000000.0d0)) then
tmp = t * (x / z)
else if (z <= 1.5d-9) then
tmp = t * -x
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -13500000000.0) {
tmp = t * (x / z);
} else if (z <= 1.5e-9) {
tmp = t * -x;
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -13500000000.0: tmp = t * (x / z) elif z <= 1.5e-9: tmp = t * -x else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -13500000000.0) tmp = Float64(t * Float64(x / z)); elseif (z <= 1.5e-9) tmp = Float64(t * Float64(-x)); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -13500000000.0) tmp = t * (x / z); elseif (z <= 1.5e-9) tmp = t * -x; else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -13500000000.0], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e-9], N[(t * (-x)), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -13500000000:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-9}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if z < -1.35e10Initial program 94.3%
Taylor expanded in y around 0 57.9%
mul-1-neg57.9%
distribute-neg-frac257.9%
neg-sub057.9%
associate--r-57.9%
metadata-eval57.9%
Simplified57.9%
Taylor expanded in z around inf 53.0%
associate-/l*58.7%
Simplified58.7%
if -1.35e10 < z < 1.49999999999999999e-9Initial program 85.7%
Taylor expanded in y around 0 32.3%
mul-1-neg32.3%
distribute-neg-frac232.3%
neg-sub032.3%
associate--r-32.3%
metadata-eval32.3%
Simplified32.3%
Taylor expanded in z around 0 31.2%
neg-mul-131.2%
*-commutative31.2%
distribute-rgt-neg-in31.2%
Simplified31.2%
if 1.49999999999999999e-9 < z Initial program 97.0%
Taylor expanded in y around 0 56.5%
mul-1-neg56.5%
distribute-neg-frac256.5%
neg-sub056.5%
associate--r-56.5%
metadata-eval56.5%
Simplified56.5%
Taylor expanded in z around inf 55.1%
Final simplification45.6%
(FPCore (x y z t) :precision binary64 (* t (- x)))
double code(double x, double y, double z, double t) {
return t * -x;
}
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 = t * -x
end function
public static double code(double x, double y, double z, double t) {
return t * -x;
}
def code(x, y, z, t): return t * -x
function code(x, y, z, t) return Float64(t * Float64(-x)) end
function tmp = code(x, y, z, t) tmp = t * -x; end
code[x_, y_, z_, t_] := N[(t * (-x)), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(-x\right)
\end{array}
Initial program 91.2%
Taylor expanded in y around 0 46.2%
mul-1-neg46.2%
distribute-neg-frac246.2%
neg-sub046.2%
associate--r-46.2%
metadata-eval46.2%
Simplified46.2%
Taylor expanded in z around 0 22.7%
neg-mul-122.7%
*-commutative22.7%
distribute-rgt-neg-in22.7%
Simplified22.7%
Final simplification22.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))))
(t_2 (* x (- (/ y z) (/ t (- 1.0 z))))))
(if (< t_2 -7.623226303312042e-196)
t_1
(if (< t_2 1.4133944927702302e-211)
(+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z))))
t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y / z) - (t * (1.0d0 / (1.0d0 - z))))
t_2 = x * ((y / z) - (t / (1.0d0 - z)))
if (t_2 < (-7.623226303312042d-196)) then
tmp = t_1
else if (t_2 < 1.4133944927702302d-211) then
tmp = ((y * x) / z) + -((t * x) / (1.0d0 - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))) t_2 = x * ((y / z) - (t / (1.0 - z))) tmp = 0 if t_2 < -7.623226303312042e-196: tmp = t_1 elif t_2 < 1.4133944927702302e-211: tmp = ((y * x) / z) + -((t * x) / (1.0 - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - Float64(t * Float64(1.0 / Float64(1.0 - z))))) t_2 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) tmp = 0.0 if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = Float64(Float64(Float64(y * x) / z) + Float64(-Float64(Float64(t * x) / Float64(1.0 - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))); t_2 = x * ((y / z) - (t / (1.0 - z))); tmp = 0.0; if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = ((y * x) / z) + -((t * x) / (1.0 - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t * N[(1.0 / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -7.623226303312042e-196], t$95$1, If[Less[t$95$2, 1.4133944927702302e-211], N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] + (-N[(N[(t * x), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\
t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathbf{if}\;t\_2 < -7.623226303312042 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4133944927702302 \cdot 10^{-211}:\\
\;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024163
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:alt
(! :herbie-platform default (if (< (* x (- (/ y z) (/ t (- 1 z)))) -3811613151656021/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 7066972463851151/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z))))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))