
(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 10 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 (<= t_1 (- INFINITY))
(* y (/ x z))
(if (<= t_1 1e+306) (* t_1 x) (/ y (/ z 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)) {
tmp = y * (x / z);
} else if (t_1 <= 1e+306) {
tmp = t_1 * x;
} else {
tmp = y / (z / 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) {
tmp = y * (x / z);
} else if (t_1 <= 1e+306) {
tmp = t_1 * x;
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) + (t / (z + -1.0)) tmp = 0 if t_1 <= -math.inf: tmp = y * (x / z) elif t_1 <= 1e+306: tmp = t_1 * x else: tmp = y / (z / 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)) tmp = Float64(y * Float64(x / z)); elseif (t_1 <= 1e+306) tmp = Float64(t_1 * x); else tmp = Float64(y / Float64(z / 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) tmp = y * (x / z); elseif (t_1 <= 1e+306) tmp = t_1 * x; else tmp = y / (z / 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[LessEqual[t$95$1, (-Infinity)], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+306], N[(t$95$1 * x), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} + \frac{t}{z + -1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{+306}:\\
\;\;\;\;t\_1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0Initial program 66.9%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
div-inv66.9%
associate-*l*99.9%
associate-/r/99.8%
clear-num99.9%
Applied egg-rr99.9%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 1.00000000000000002e306Initial program 98.6%
if 1.00000000000000002e306 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 57.1%
Taylor expanded in y around inf 57.1%
*-commutative57.1%
div-inv57.1%
associate-*l*99.9%
associate-/r/99.9%
clear-num99.9%
Applied egg-rr99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ y z) x)))
(if (<= z -3e+171)
(/ (* t x) z)
(if (<= z -4.05e+158)
t_1
(if (<= z -2.8e+123)
(/ x (/ z t))
(if (<= z -2.3e+57)
t_1
(if (<= z -1.8e+32)
(* t (/ x z))
(if (<= z 5.8e+23)
(* x (- (/ y z) t))
(if (<= z 1.35e+108) (* x (/ t z)) t_1)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) * x;
double tmp;
if (z <= -3e+171) {
tmp = (t * x) / z;
} else if (z <= -4.05e+158) {
tmp = t_1;
} else if (z <= -2.8e+123) {
tmp = x / (z / t);
} else if (z <= -2.3e+57) {
tmp = t_1;
} else if (z <= -1.8e+32) {
tmp = t * (x / z);
} else if (z <= 5.8e+23) {
tmp = x * ((y / z) - t);
} else if (z <= 1.35e+108) {
tmp = x * (t / 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) :: tmp
t_1 = (y / z) * x
if (z <= (-3d+171)) then
tmp = (t * x) / z
else if (z <= (-4.05d+158)) then
tmp = t_1
else if (z <= (-2.8d+123)) then
tmp = x / (z / t)
else if (z <= (-2.3d+57)) then
tmp = t_1
else if (z <= (-1.8d+32)) then
tmp = t * (x / z)
else if (z <= 5.8d+23) then
tmp = x * ((y / z) - t)
else if (z <= 1.35d+108) then
tmp = x * (t / 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 = (y / z) * x;
double tmp;
if (z <= -3e+171) {
tmp = (t * x) / z;
} else if (z <= -4.05e+158) {
tmp = t_1;
} else if (z <= -2.8e+123) {
tmp = x / (z / t);
} else if (z <= -2.3e+57) {
tmp = t_1;
} else if (z <= -1.8e+32) {
tmp = t * (x / z);
} else if (z <= 5.8e+23) {
tmp = x * ((y / z) - t);
} else if (z <= 1.35e+108) {
tmp = x * (t / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) * x tmp = 0 if z <= -3e+171: tmp = (t * x) / z elif z <= -4.05e+158: tmp = t_1 elif z <= -2.8e+123: tmp = x / (z / t) elif z <= -2.3e+57: tmp = t_1 elif z <= -1.8e+32: tmp = t * (x / z) elif z <= 5.8e+23: tmp = x * ((y / z) - t) elif z <= 1.35e+108: tmp = x * (t / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) * x) tmp = 0.0 if (z <= -3e+171) tmp = Float64(Float64(t * x) / z); elseif (z <= -4.05e+158) tmp = t_1; elseif (z <= -2.8e+123) tmp = Float64(x / Float64(z / t)); elseif (z <= -2.3e+57) tmp = t_1; elseif (z <= -1.8e+32) tmp = Float64(t * Float64(x / z)); elseif (z <= 5.8e+23) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (z <= 1.35e+108) tmp = Float64(x * Float64(t / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) * x; tmp = 0.0; if (z <= -3e+171) tmp = (t * x) / z; elseif (z <= -4.05e+158) tmp = t_1; elseif (z <= -2.8e+123) tmp = x / (z / t); elseif (z <= -2.3e+57) tmp = t_1; elseif (z <= -1.8e+32) tmp = t * (x / z); elseif (z <= 5.8e+23) tmp = x * ((y / z) - t); elseif (z <= 1.35e+108) tmp = x * (t / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -3e+171], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -4.05e+158], t$95$1, If[LessEqual[z, -2.8e+123], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e+57], t$95$1, If[LessEqual[z, -1.8e+32], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+23], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e+108], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} \cdot x\\
\mathbf{if}\;z \leq -3 \cdot 10^{+171}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\mathbf{elif}\;z \leq -4.05 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{+123}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{+32}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+23}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+108}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.0000000000000001e171Initial program 96.4%
Taylor expanded in z around inf 93.0%
*-commutative93.0%
associate-/l*72.8%
cancel-sign-sub-inv72.8%
metadata-eval72.8%
*-lft-identity72.8%
+-commutative72.8%
Simplified72.8%
Taylor expanded in t around inf 76.1%
if -3.0000000000000001e171 < z < -4.0499999999999999e158 or -2.80000000000000011e123 < z < -2.2999999999999999e57 or 1.35e108 < z Initial program 96.3%
Taylor expanded in y around inf 67.8%
if -4.0499999999999999e158 < z < -2.80000000000000011e123Initial program 99.6%
clear-num99.6%
associate-/r/99.3%
Applied egg-rr99.3%
Taylor expanded in z around inf 99.6%
sub-neg99.6%
neg-mul-199.6%
remove-double-neg99.6%
Simplified99.6%
clear-num99.6%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 85.8%
if -2.2999999999999999e57 < z < -1.7999999999999998e32Initial program 100.0%
Taylor expanded in z around inf 100.0%
*-commutative100.0%
associate-/l*100.0%
cancel-sign-sub-inv100.0%
metadata-eval100.0%
*-lft-identity100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
associate-*r/100.0%
Simplified100.0%
if -1.7999999999999998e32 < z < 5.80000000000000025e23Initial program 92.3%
Taylor expanded in z around 0 91.0%
if 5.80000000000000025e23 < z < 1.35e108Initial program 99.8%
clear-num99.7%
associate-/r/99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 99.8%
sub-neg99.8%
neg-mul-199.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 70.9%
Final simplification83.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- x))) (t_2 (* x (/ t z))))
(if (<= t -5.7e+206)
t_1
(if (<= t -1.65e+117)
t_2
(if (<= t 1.85e+114)
(/ x (/ z y))
(if (or (<= t 1e+157) (not (<= t 2.2e+192))) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = t * -x;
double t_2 = x * (t / z);
double tmp;
if (t <= -5.7e+206) {
tmp = t_1;
} else if (t <= -1.65e+117) {
tmp = t_2;
} else if (t <= 1.85e+114) {
tmp = x / (z / y);
} else if ((t <= 1e+157) || !(t <= 2.2e+192)) {
tmp = t_2;
} 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 = t * -x
t_2 = x * (t / z)
if (t <= (-5.7d+206)) then
tmp = t_1
else if (t <= (-1.65d+117)) then
tmp = t_2
else if (t <= 1.85d+114) then
tmp = x / (z / y)
else if ((t <= 1d+157) .or. (.not. (t <= 2.2d+192))) then
tmp = t_2
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 = t * -x;
double t_2 = x * (t / z);
double tmp;
if (t <= -5.7e+206) {
tmp = t_1;
} else if (t <= -1.65e+117) {
tmp = t_2;
} else if (t <= 1.85e+114) {
tmp = x / (z / y);
} else if ((t <= 1e+157) || !(t <= 2.2e+192)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * -x t_2 = x * (t / z) tmp = 0 if t <= -5.7e+206: tmp = t_1 elif t <= -1.65e+117: tmp = t_2 elif t <= 1.85e+114: tmp = x / (z / y) elif (t <= 1e+157) or not (t <= 2.2e+192): tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(-x)) t_2 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -5.7e+206) tmp = t_1; elseif (t <= -1.65e+117) tmp = t_2; elseif (t <= 1.85e+114) tmp = Float64(x / Float64(z / y)); elseif ((t <= 1e+157) || !(t <= 2.2e+192)) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * -x; t_2 = x * (t / z); tmp = 0.0; if (t <= -5.7e+206) tmp = t_1; elseif (t <= -1.65e+117) tmp = t_2; elseif (t <= 1.85e+114) tmp = x / (z / y); elseif ((t <= 1e+157) || ~((t <= 2.2e+192))) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * (-x)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.7e+206], t$95$1, If[LessEqual[t, -1.65e+117], t$95$2, If[LessEqual[t, 1.85e+114], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 1e+157], N[Not[LessEqual[t, 2.2e+192]], $MachinePrecision]], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(-x\right)\\
t_2 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -5.7 \cdot 10^{+206}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.65 \cdot 10^{+117}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{+114}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;t \leq 10^{+157} \lor \neg \left(t \leq 2.2 \cdot 10^{+192}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.6999999999999998e206 or 9.99999999999999983e156 < t < 2.2000000000000001e192Initial program 97.3%
Taylor expanded in z around 0 74.6%
Taylor expanded in y around 0 59.3%
mul-1-neg59.3%
distribute-lft-neg-out59.3%
*-commutative59.3%
Simplified59.3%
if -5.6999999999999998e206 < t < -1.6499999999999999e117 or 1.85e114 < t < 9.99999999999999983e156 or 2.2000000000000001e192 < t Initial program 98.1%
clear-num98.0%
associate-/r/98.0%
Applied egg-rr98.0%
Taylor expanded in z around inf 73.8%
sub-neg73.8%
neg-mul-173.8%
remove-double-neg73.8%
Simplified73.8%
Taylor expanded in y around 0 65.2%
if -1.6499999999999999e117 < t < 1.85e114Initial program 92.5%
Taylor expanded in y around inf 72.0%
clear-num71.9%
un-div-inv72.4%
Applied egg-rr72.4%
Final simplification69.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- x))) (t_2 (* x (/ t z))))
(if (<= t -2.4e+207)
t_1
(if (<= t -8.5e+86)
t_2
(if (<= t 3.6e+111)
(* (/ y z) x)
(if (or (<= t 1.7e+156) (not (<= t 2.15e+192))) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = t * -x;
double t_2 = x * (t / z);
double tmp;
if (t <= -2.4e+207) {
tmp = t_1;
} else if (t <= -8.5e+86) {
tmp = t_2;
} else if (t <= 3.6e+111) {
tmp = (y / z) * x;
} else if ((t <= 1.7e+156) || !(t <= 2.15e+192)) {
tmp = t_2;
} 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 = t * -x
t_2 = x * (t / z)
if (t <= (-2.4d+207)) then
tmp = t_1
else if (t <= (-8.5d+86)) then
tmp = t_2
else if (t <= 3.6d+111) then
tmp = (y / z) * x
else if ((t <= 1.7d+156) .or. (.not. (t <= 2.15d+192))) then
tmp = t_2
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 = t * -x;
double t_2 = x * (t / z);
double tmp;
if (t <= -2.4e+207) {
tmp = t_1;
} else if (t <= -8.5e+86) {
tmp = t_2;
} else if (t <= 3.6e+111) {
tmp = (y / z) * x;
} else if ((t <= 1.7e+156) || !(t <= 2.15e+192)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * -x t_2 = x * (t / z) tmp = 0 if t <= -2.4e+207: tmp = t_1 elif t <= -8.5e+86: tmp = t_2 elif t <= 3.6e+111: tmp = (y / z) * x elif (t <= 1.7e+156) or not (t <= 2.15e+192): tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(-x)) t_2 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -2.4e+207) tmp = t_1; elseif (t <= -8.5e+86) tmp = t_2; elseif (t <= 3.6e+111) tmp = Float64(Float64(y / z) * x); elseif ((t <= 1.7e+156) || !(t <= 2.15e+192)) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * -x; t_2 = x * (t / z); tmp = 0.0; if (t <= -2.4e+207) tmp = t_1; elseif (t <= -8.5e+86) tmp = t_2; elseif (t <= 3.6e+111) tmp = (y / z) * x; elseif ((t <= 1.7e+156) || ~((t <= 2.15e+192))) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * (-x)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.4e+207], t$95$1, If[LessEqual[t, -8.5e+86], t$95$2, If[LessEqual[t, 3.6e+111], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[Or[LessEqual[t, 1.7e+156], N[Not[LessEqual[t, 2.15e+192]], $MachinePrecision]], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(-x\right)\\
t_2 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{+207}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{+86}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+111}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+156} \lor \neg \left(t \leq 2.15 \cdot 10^{+192}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.4000000000000001e207 or 1.7e156 < t < 2.14999999999999988e192Initial program 97.3%
Taylor expanded in z around 0 74.6%
Taylor expanded in y around 0 59.3%
mul-1-neg59.3%
distribute-lft-neg-out59.3%
*-commutative59.3%
Simplified59.3%
if -2.4000000000000001e207 < t < -8.5000000000000005e86 or 3.6000000000000002e111 < t < 1.7e156 or 2.14999999999999988e192 < t Initial program 96.6%
clear-num96.5%
associate-/r/96.6%
Applied egg-rr96.6%
Taylor expanded in z around inf 71.6%
sub-neg71.6%
neg-mul-171.6%
remove-double-neg71.6%
Simplified71.6%
Taylor expanded in y around 0 62.4%
if -8.5000000000000005e86 < t < 3.6000000000000002e111Initial program 92.8%
Taylor expanded in y around inf 73.4%
Final simplification69.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.8e+31) (not (<= z 0.000115))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.8e+31) || !(z <= 0.000115)) {
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 <= (-4.8d+31)) .or. (.not. (z <= 0.000115d0))) 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 <= -4.8e+31) || !(z <= 0.000115)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.8e+31) or not (z <= 0.000115): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.8e+31) || !(z <= 0.000115)) 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 <= -4.8e+31) || ~((z <= 0.000115))) 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, -4.8e+31], N[Not[LessEqual[z, 0.000115]], $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 -4.8 \cdot 10^{+31} \lor \neg \left(z \leq 0.000115\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -4.79999999999999965e31 or 1.15e-4 < z Initial program 97.3%
Taylor expanded in z around inf 97.2%
cancel-sign-sub-inv97.2%
metadata-eval97.2%
*-lft-identity97.2%
+-commutative97.2%
Simplified97.2%
if -4.79999999999999965e31 < z < 1.15e-4Initial program 91.9%
Taylor expanded in z around 0 91.2%
Final simplification93.9%
(FPCore (x y z t) :precision binary64 (if (<= z -1.25e-10) (/ x (/ z (+ y t))) (if (<= z 0.000115) (* x (- (/ y z) t)) (* x (/ (+ y t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.25e-10) {
tmp = x / (z / (y + t));
} else if (z <= 0.000115) {
tmp = x * ((y / z) - t);
} else {
tmp = x * ((y + 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 <= (-1.25d-10)) then
tmp = x / (z / (y + t))
else if (z <= 0.000115d0) then
tmp = x * ((y / z) - t)
else
tmp = x * ((y + t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.25e-10) {
tmp = x / (z / (y + t));
} else if (z <= 0.000115) {
tmp = x * ((y / z) - t);
} else {
tmp = x * ((y + t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.25e-10: tmp = x / (z / (y + t)) elif z <= 0.000115: tmp = x * ((y / z) - t) else: tmp = x * ((y + t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.25e-10) tmp = Float64(x / Float64(z / Float64(y + t))); elseif (z <= 0.000115) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(x * Float64(Float64(y + t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.25e-10) tmp = x / (z / (y + t)); elseif (z <= 0.000115) tmp = x * ((y / z) - t); else tmp = x * ((y + t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.25e-10], N[(x / N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.000115], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-10}:\\
\;\;\;\;\frac{x}{\frac{z}{y + t}}\\
\mathbf{elif}\;z \leq 0.000115:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\end{array}
\end{array}
if z < -1.25000000000000008e-10Initial program 96.5%
clear-num96.5%
associate-/r/96.5%
Applied egg-rr96.5%
Taylor expanded in z around inf 95.0%
sub-neg95.0%
neg-mul-195.0%
remove-double-neg95.0%
Simplified95.0%
clear-num94.9%
un-div-inv96.1%
Applied egg-rr96.1%
if -1.25000000000000008e-10 < z < 1.15e-4Initial program 92.3%
Taylor expanded in z around 0 92.0%
if 1.15e-4 < z Initial program 96.7%
Taylor expanded in z around inf 96.5%
cancel-sign-sub-inv96.5%
metadata-eval96.5%
*-lft-identity96.5%
+-commutative96.5%
Simplified96.5%
Final simplification94.0%
(FPCore (x y z t) :precision binary64 (if (<= y -7e-43) (* y (/ x z)) (if (<= y 2.55e-80) (* x (/ t (+ z -1.0))) (/ (* y x) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e-43) {
tmp = y * (x / z);
} else if (y <= 2.55e-80) {
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 (y <= (-7d-43)) then
tmp = y * (x / z)
else if (y <= 2.55d-80) 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 (y <= -7e-43) {
tmp = y * (x / z);
} else if (y <= 2.55e-80) {
tmp = x * (t / (z + -1.0));
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7e-43: tmp = y * (x / z) elif y <= 2.55e-80: tmp = x * (t / (z + -1.0)) else: tmp = (y * x) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7e-43) tmp = Float64(y * Float64(x / z)); elseif (y <= 2.55e-80) 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 (y <= -7e-43) tmp = y * (x / z); elseif (y <= 2.55e-80) tmp = x * (t / (z + -1.0)); else tmp = (y * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7e-43], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.55e-80], 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}\;y \leq -7 \cdot 10^{-43}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{-80}:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if y < -6.99999999999999994e-43Initial program 91.2%
Taylor expanded in y around inf 80.4%
*-commutative80.4%
div-inv80.4%
associate-*l*82.1%
associate-/r/81.4%
clear-num82.1%
Applied egg-rr82.1%
if -6.99999999999999994e-43 < y < 2.55000000000000004e-80Initial program 97.4%
clear-num97.2%
associate-/r/97.3%
Applied egg-rr97.3%
Taylor expanded in y around 0 75.8%
mul-1-neg75.8%
distribute-frac-neg275.8%
sub0-neg75.8%
associate--r-75.8%
metadata-eval75.8%
Simplified75.8%
if 2.55000000000000004e-80 < y Initial program 92.4%
Taylor expanded in y around inf 75.6%
Final simplification77.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* x (/ t z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = x * (t / 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 <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * (t / 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 <= -1.0) || !(z <= 1.0)) {
tmp = x * (t / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = x * (t / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(t * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = x * (t / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 97.3%
clear-num97.2%
associate-/r/97.2%
Applied egg-rr97.2%
Taylor expanded in z around inf 97.2%
sub-neg97.2%
neg-mul-197.2%
remove-double-neg97.2%
Simplified97.2%
Taylor expanded in y around 0 56.4%
if -1 < z < 1Initial program 91.8%
Taylor expanded in z around 0 91.1%
Taylor expanded in y around 0 40.3%
mul-1-neg40.3%
distribute-lft-neg-out40.3%
*-commutative40.3%
Simplified40.3%
Final simplification47.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* t (/ x z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
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 <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) 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 <= -1.0) || !(z <= 1.0)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = t * (x / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) 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 <= -1.0) || ~((z <= 1.0))) tmp = t * (x / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 97.3%
Taylor expanded in z around inf 84.9%
*-commutative84.9%
associate-/l*83.7%
cancel-sign-sub-inv83.7%
metadata-eval83.7%
*-lft-identity83.7%
+-commutative83.7%
Simplified83.7%
Taylor expanded in t around inf 53.1%
associate-*r/50.2%
Simplified50.2%
if -1 < z < 1Initial program 91.8%
Taylor expanded in z around 0 91.1%
Taylor expanded in y around 0 40.3%
mul-1-neg40.3%
distribute-lft-neg-out40.3%
*-commutative40.3%
Simplified40.3%
Final simplification44.7%
(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 94.3%
Taylor expanded in z around 0 66.0%
Taylor expanded in y around 0 27.0%
mul-1-neg27.0%
distribute-lft-neg-out27.0%
*-commutative27.0%
Simplified27.0%
Final simplification27.0%
(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 2024097
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:alt
(if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))