
(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 12 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 (- 1.0 z)))) (t_2 (* x t_1)))
(if (<= t_1 -5e+293)
(/ (* x y) z)
(if (<= t_1 -5e-269)
t_2
(if (<= t_1 0.0)
(* (/ x z) (+ y t))
(if (<= t_1 1e+259) t_2 (/ y (/ z x))))))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double t_2 = x * t_1;
double tmp;
if (t_1 <= -5e+293) {
tmp = (x * y) / z;
} else if (t_1 <= -5e-269) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = (x / z) * (y + t);
} else if (t_1 <= 1e+259) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y / z) - (t / (1.0d0 - z))
t_2 = x * t_1
if (t_1 <= (-5d+293)) then
tmp = (x * y) / z
else if (t_1 <= (-5d-269)) then
tmp = t_2
else if (t_1 <= 0.0d0) then
tmp = (x / z) * (y + t)
else if (t_1 <= 1d+259) then
tmp = t_2
else
tmp = y / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double t_2 = x * t_1;
double tmp;
if (t_1 <= -5e+293) {
tmp = (x * y) / z;
} else if (t_1 <= -5e-269) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = (x / z) * (y + t);
} else if (t_1 <= 1e+259) {
tmp = t_2;
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) t_2 = x * t_1 tmp = 0 if t_1 <= -5e+293: tmp = (x * y) / z elif t_1 <= -5e-269: tmp = t_2 elif t_1 <= 0.0: tmp = (x / z) * (y + t) elif t_1 <= 1e+259: tmp = t_2 else: tmp = y / (z / x) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) t_2 = Float64(x * t_1) tmp = 0.0 if (t_1 <= -5e+293) tmp = Float64(Float64(x * y) / z); elseif (t_1 <= -5e-269) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(Float64(x / z) * Float64(y + t)); elseif (t_1 <= 1e+259) tmp = t_2; else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) - (t / (1.0 - z)); t_2 = x * t_1; tmp = 0.0; if (t_1 <= -5e+293) tmp = (x * y) / z; elseif (t_1 <= -5e-269) tmp = t_2; elseif (t_1 <= 0.0) tmp = (x / z) * (y + t); elseif (t_1 <= 1e+259) tmp = t_2; 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[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+293], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, -5e-269], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(x / z), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+259], t$95$2, N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
t_2 := x \cdot t_1\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+293}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-269}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\
\mathbf{elif}\;t_1 \leq 10^{+259}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < -5.00000000000000033e293Initial program 69.8%
Taylor expanded in y around inf 99.9%
if -5.00000000000000033e293 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < -4.99999999999999979e-269 or 0.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 9.999999999999999e258Initial program 99.8%
if -4.99999999999999979e-269 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 0.0Initial program 65.5%
Taylor expanded in z around inf 99.8%
associate-/l*65.4%
associate-/r/99.8%
cancel-sign-sub-inv99.8%
metadata-eval99.8%
*-lft-identity99.8%
+-commutative99.8%
Simplified99.8%
if 9.999999999999999e258 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) Initial program 72.9%
Taylor expanded in y around inf 99.9%
associate-/l*75.6%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
div-inv99.9%
Applied egg-rr99.9%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ (/ y z) (/ t z)))))
(if (<= z -1.75e+21)
t_1
(if (<= z 6.8e-273)
(* x (- (/ y z) t))
(if (<= z 1.4e-44)
(/ (* x y) z)
(if (<= z 82000.0) (/ (* x t) (+ z -1.0)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) + (t / z));
double tmp;
if (z <= -1.75e+21) {
tmp = t_1;
} else if (z <= 6.8e-273) {
tmp = x * ((y / z) - t);
} else if (z <= 1.4e-44) {
tmp = (x * y) / z;
} else if (z <= 82000.0) {
tmp = (x * t) / (z + -1.0);
} 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 = x * ((y / z) + (t / z))
if (z <= (-1.75d+21)) then
tmp = t_1
else if (z <= 6.8d-273) then
tmp = x * ((y / z) - t)
else if (z <= 1.4d-44) then
tmp = (x * y) / z
else if (z <= 82000.0d0) then
tmp = (x * t) / (z + (-1.0d0))
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 / z));
double tmp;
if (z <= -1.75e+21) {
tmp = t_1;
} else if (z <= 6.8e-273) {
tmp = x * ((y / z) - t);
} else if (z <= 1.4e-44) {
tmp = (x * y) / z;
} else if (z <= 82000.0) {
tmp = (x * t) / (z + -1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) + (t / z)) tmp = 0 if z <= -1.75e+21: tmp = t_1 elif z <= 6.8e-273: tmp = x * ((y / z) - t) elif z <= 1.4e-44: tmp = (x * y) / z elif z <= 82000.0: tmp = (x * t) / (z + -1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) + Float64(t / z))) tmp = 0.0 if (z <= -1.75e+21) tmp = t_1; elseif (z <= 6.8e-273) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (z <= 1.4e-44) tmp = Float64(Float64(x * y) / z); elseif (z <= 82000.0) tmp = Float64(Float64(x * t) / Float64(z + -1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) + (t / z)); tmp = 0.0; if (z <= -1.75e+21) tmp = t_1; elseif (z <= 6.8e-273) tmp = x * ((y / z) - t); elseif (z <= 1.4e-44) tmp = (x * y) / z; elseif (z <= 82000.0) tmp = (x * t) / (z + -1.0); 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 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+21], t$95$1, If[LessEqual[z, 6.8e-273], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-44], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 82000.0], N[(N[(x * t), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-273}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-44}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 82000:\\
\;\;\;\;\frac{x \cdot t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.75e21 or 82000 < z Initial program 94.5%
Taylor expanded in z around inf 94.5%
associate-*r/94.5%
neg-mul-194.5%
Simplified94.5%
if -1.75e21 < z < 6.79999999999999982e-273Initial program 94.9%
Taylor expanded in z around 0 89.1%
+-commutative89.1%
associate-*r/90.9%
*-commutative90.9%
associate-*r*90.9%
neg-mul-190.9%
distribute-rgt-out94.7%
unsub-neg94.7%
Simplified94.7%
if 6.79999999999999982e-273 < z < 1.4e-44Initial program 75.8%
Taylor expanded in y around inf 88.8%
if 1.4e-44 < z < 82000Initial program 99.9%
Taylor expanded in y around 0 82.5%
associate-*r/82.5%
associate-*r*82.5%
neg-mul-182.5%
associate-*l/82.4%
*-commutative82.4%
distribute-frac-neg82.4%
mul-1-neg82.4%
associate-*r/82.4%
*-commutative82.4%
associate-*r/82.2%
metadata-eval82.2%
associate-/r*82.2%
neg-mul-182.2%
associate-*r/82.4%
*-rgt-identity82.4%
neg-sub082.4%
associate--r-82.4%
metadata-eval82.4%
Simplified82.4%
Taylor expanded in x around 0 82.5%
Final simplification93.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ (/ y z) (/ t z)))))
(if (<= z -1.75e+21)
t_1
(if (<= z 8.5e-272)
(* x (- (/ y z) t))
(if (<= z 6.2e-172)
(/ (* x y) z)
(if (<= z 1.0) (- (/ y (/ z x)) (* x t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) + (t / z));
double tmp;
if (z <= -1.75e+21) {
tmp = t_1;
} else if (z <= 8.5e-272) {
tmp = x * ((y / z) - t);
} else if (z <= 6.2e-172) {
tmp = (x * y) / z;
} else if (z <= 1.0) {
tmp = (y / (z / x)) - (x * t);
} 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 = x * ((y / z) + (t / z))
if (z <= (-1.75d+21)) then
tmp = t_1
else if (z <= 8.5d-272) then
tmp = x * ((y / z) - t)
else if (z <= 6.2d-172) then
tmp = (x * y) / z
else if (z <= 1.0d0) then
tmp = (y / (z / x)) - (x * t)
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 / z));
double tmp;
if (z <= -1.75e+21) {
tmp = t_1;
} else if (z <= 8.5e-272) {
tmp = x * ((y / z) - t);
} else if (z <= 6.2e-172) {
tmp = (x * y) / z;
} else if (z <= 1.0) {
tmp = (y / (z / x)) - (x * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) + (t / z)) tmp = 0 if z <= -1.75e+21: tmp = t_1 elif z <= 8.5e-272: tmp = x * ((y / z) - t) elif z <= 6.2e-172: tmp = (x * y) / z elif z <= 1.0: tmp = (y / (z / x)) - (x * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) + Float64(t / z))) tmp = 0.0 if (z <= -1.75e+21) tmp = t_1; elseif (z <= 8.5e-272) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (z <= 6.2e-172) tmp = Float64(Float64(x * y) / z); elseif (z <= 1.0) tmp = Float64(Float64(y / Float64(z / x)) - Float64(x * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) + (t / z)); tmp = 0.0; if (z <= -1.75e+21) tmp = t_1; elseif (z <= 8.5e-272) tmp = x * ((y / z) - t); elseif (z <= 6.2e-172) tmp = (x * y) / z; elseif (z <= 1.0) tmp = (y / (z / x)) - (x * t); 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 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+21], t$95$1, If[LessEqual[z, 8.5e-272], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e-172], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-272}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-172}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{y}{\frac{z}{x}} - x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.75e21 or 1 < z Initial program 94.6%
Taylor expanded in z around inf 93.6%
associate-*r/93.6%
neg-mul-193.6%
Simplified93.6%
if -1.75e21 < z < 8.5000000000000001e-272Initial program 94.9%
Taylor expanded in z around 0 89.1%
+-commutative89.1%
associate-*r/90.9%
*-commutative90.9%
associate-*r*90.9%
neg-mul-190.9%
distribute-rgt-out94.7%
unsub-neg94.7%
Simplified94.7%
if 8.5000000000000001e-272 < z < 6.2000000000000005e-172Initial program 71.5%
Taylor expanded in y around inf 95.0%
if 6.2000000000000005e-172 < z < 1Initial program 85.3%
sub-neg85.3%
distribute-rgt-in85.3%
distribute-neg-frac85.3%
Applied egg-rr85.3%
associate-*l/100.0%
associate-/l*100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 93.7%
associate-*r*93.7%
mul-1-neg93.7%
Simplified93.7%
Final simplification94.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x z) (+ y t))))
(if (<= z -95000000.0)
t_1
(if (<= z 1.2e-271)
(* x (- (/ y z) t))
(if (<= z 1.35e-44)
(/ (* x y) z)
(if (<= z 82000.0) (* x (/ t (+ z -1.0))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / z) * (y + t);
double tmp;
if (z <= -95000000.0) {
tmp = t_1;
} else if (z <= 1.2e-271) {
tmp = x * ((y / z) - t);
} else if (z <= 1.35e-44) {
tmp = (x * y) / z;
} else if (z <= 82000.0) {
tmp = x * (t / (z + -1.0));
} 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 = (x / z) * (y + t)
if (z <= (-95000000.0d0)) then
tmp = t_1
else if (z <= 1.2d-271) then
tmp = x * ((y / z) - t)
else if (z <= 1.35d-44) then
tmp = (x * y) / z
else if (z <= 82000.0d0) then
tmp = x * (t / (z + (-1.0d0)))
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 / z) * (y + t);
double tmp;
if (z <= -95000000.0) {
tmp = t_1;
} else if (z <= 1.2e-271) {
tmp = x * ((y / z) - t);
} else if (z <= 1.35e-44) {
tmp = (x * y) / z;
} else if (z <= 82000.0) {
tmp = x * (t / (z + -1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) * (y + t) tmp = 0 if z <= -95000000.0: tmp = t_1 elif z <= 1.2e-271: tmp = x * ((y / z) - t) elif z <= 1.35e-44: tmp = (x * y) / z elif z <= 82000.0: tmp = x * (t / (z + -1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) * Float64(y + t)) tmp = 0.0 if (z <= -95000000.0) tmp = t_1; elseif (z <= 1.2e-271) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (z <= 1.35e-44) tmp = Float64(Float64(x * y) / z); elseif (z <= 82000.0) tmp = Float64(x * Float64(t / Float64(z + -1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) * (y + t); tmp = 0.0; if (z <= -95000000.0) tmp = t_1; elseif (z <= 1.2e-271) tmp = x * ((y / z) - t); elseif (z <= 1.35e-44) tmp = (x * y) / z; elseif (z <= 82000.0) tmp = x * (t / (z + -1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -95000000.0], t$95$1, If[LessEqual[z, 1.2e-271], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e-44], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 82000.0], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot \left(y + t\right)\\
\mathbf{if}\;z \leq -95000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-271}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-44}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 82000:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -9.5e7 or 82000 < z Initial program 94.6%
Taylor expanded in z around inf 83.7%
associate-/l*94.6%
associate-/r/90.5%
cancel-sign-sub-inv90.5%
metadata-eval90.5%
*-lft-identity90.5%
+-commutative90.5%
Simplified90.5%
if -9.5e7 < z < 1.2000000000000001e-271Initial program 94.8%
Taylor expanded in z around 0 88.6%
+-commutative88.6%
associate-*r/90.5%
*-commutative90.5%
associate-*r*90.5%
neg-mul-190.5%
distribute-rgt-out94.5%
unsub-neg94.5%
Simplified94.5%
if 1.2000000000000001e-271 < z < 1.35e-44Initial program 75.8%
Taylor expanded in y around inf 88.8%
if 1.35e-44 < z < 82000Initial program 99.9%
Taylor expanded in y around 0 82.5%
associate-*r/82.5%
associate-*r*82.5%
neg-mul-182.5%
associate-*l/82.4%
*-commutative82.4%
distribute-frac-neg82.4%
mul-1-neg82.4%
associate-*r/82.4%
*-commutative82.4%
associate-*r/82.2%
metadata-eval82.2%
associate-/r*82.2%
neg-mul-182.2%
associate-*r/82.4%
*-rgt-identity82.4%
neg-sub082.4%
associate--r-82.4%
metadata-eval82.4%
Simplified82.4%
Final simplification91.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ z (+ y t)))))
(if (<= z -9.2e+17)
t_1
(if (<= z 1.7e-272)
(* x (- (/ y z) t))
(if (<= z 1.4e-44)
(/ (* x y) z)
(if (<= z 82000.0) (* x (/ t (+ z -1.0))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z / (y + t));
double tmp;
if (z <= -9.2e+17) {
tmp = t_1;
} else if (z <= 1.7e-272) {
tmp = x * ((y / z) - t);
} else if (z <= 1.4e-44) {
tmp = (x * y) / z;
} else if (z <= 82000.0) {
tmp = x * (t / (z + -1.0));
} 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 = x / (z / (y + t))
if (z <= (-9.2d+17)) then
tmp = t_1
else if (z <= 1.7d-272) then
tmp = x * ((y / z) - t)
else if (z <= 1.4d-44) then
tmp = (x * y) / z
else if (z <= 82000.0d0) then
tmp = x * (t / (z + (-1.0d0)))
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 / (z / (y + t));
double tmp;
if (z <= -9.2e+17) {
tmp = t_1;
} else if (z <= 1.7e-272) {
tmp = x * ((y / z) - t);
} else if (z <= 1.4e-44) {
tmp = (x * y) / z;
} else if (z <= 82000.0) {
tmp = x * (t / (z + -1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z / (y + t)) tmp = 0 if z <= -9.2e+17: tmp = t_1 elif z <= 1.7e-272: tmp = x * ((y / z) - t) elif z <= 1.4e-44: tmp = (x * y) / z elif z <= 82000.0: tmp = x * (t / (z + -1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z / Float64(y + t))) tmp = 0.0 if (z <= -9.2e+17) tmp = t_1; elseif (z <= 1.7e-272) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (z <= 1.4e-44) tmp = Float64(Float64(x * y) / z); elseif (z <= 82000.0) tmp = Float64(x * Float64(t / Float64(z + -1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z / (y + t)); tmp = 0.0; if (z <= -9.2e+17) tmp = t_1; elseif (z <= 1.7e-272) tmp = x * ((y / z) - t); elseif (z <= 1.4e-44) tmp = (x * y) / z; elseif (z <= 82000.0) tmp = x * (t / (z + -1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.2e+17], t$95$1, If[LessEqual[z, 1.7e-272], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-44], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 82000.0], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{y + t}}\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-272}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-44}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 82000:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -9.2e17 or 82000 < z Initial program 94.5%
Taylor expanded in z around inf 83.5%
associate-/l*94.5%
cancel-sign-sub-inv94.5%
metadata-eval94.5%
*-lft-identity94.5%
+-commutative94.5%
Simplified94.5%
if -9.2e17 < z < 1.7000000000000002e-272Initial program 94.9%
Taylor expanded in z around 0 88.9%
+-commutative88.9%
associate-*r/90.8%
*-commutative90.8%
associate-*r*90.8%
neg-mul-190.8%
distribute-rgt-out94.7%
unsub-neg94.7%
Simplified94.7%
if 1.7000000000000002e-272 < z < 1.4e-44Initial program 75.8%
Taylor expanded in y around inf 88.8%
if 1.4e-44 < z < 82000Initial program 99.9%
Taylor expanded in y around 0 82.5%
associate-*r/82.5%
associate-*r*82.5%
neg-mul-182.5%
associate-*l/82.4%
*-commutative82.4%
distribute-frac-neg82.4%
mul-1-neg82.4%
associate-*r/82.4%
*-commutative82.4%
associate-*r/82.2%
metadata-eval82.2%
associate-/r*82.2%
neg-mul-182.2%
associate-*r/82.4%
*-rgt-identity82.4%
neg-sub082.4%
associate--r-82.4%
metadata-eval82.4%
Simplified82.4%
Final simplification93.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ z (+ y t)))))
(if (<= z -9.2e+17)
t_1
(if (<= z 7.6e-272)
(* x (- (/ y z) t))
(if (<= z 1.15e-44)
(/ (* x y) z)
(if (<= z 82000.0) (/ (* x t) (+ z -1.0)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z / (y + t));
double tmp;
if (z <= -9.2e+17) {
tmp = t_1;
} else if (z <= 7.6e-272) {
tmp = x * ((y / z) - t);
} else if (z <= 1.15e-44) {
tmp = (x * y) / z;
} else if (z <= 82000.0) {
tmp = (x * t) / (z + -1.0);
} 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 = x / (z / (y + t))
if (z <= (-9.2d+17)) then
tmp = t_1
else if (z <= 7.6d-272) then
tmp = x * ((y / z) - t)
else if (z <= 1.15d-44) then
tmp = (x * y) / z
else if (z <= 82000.0d0) then
tmp = (x * t) / (z + (-1.0d0))
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 / (z / (y + t));
double tmp;
if (z <= -9.2e+17) {
tmp = t_1;
} else if (z <= 7.6e-272) {
tmp = x * ((y / z) - t);
} else if (z <= 1.15e-44) {
tmp = (x * y) / z;
} else if (z <= 82000.0) {
tmp = (x * t) / (z + -1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z / (y + t)) tmp = 0 if z <= -9.2e+17: tmp = t_1 elif z <= 7.6e-272: tmp = x * ((y / z) - t) elif z <= 1.15e-44: tmp = (x * y) / z elif z <= 82000.0: tmp = (x * t) / (z + -1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z / Float64(y + t))) tmp = 0.0 if (z <= -9.2e+17) tmp = t_1; elseif (z <= 7.6e-272) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (z <= 1.15e-44) tmp = Float64(Float64(x * y) / z); elseif (z <= 82000.0) tmp = Float64(Float64(x * t) / Float64(z + -1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z / (y + t)); tmp = 0.0; if (z <= -9.2e+17) tmp = t_1; elseif (z <= 7.6e-272) tmp = x * ((y / z) - t); elseif (z <= 1.15e-44) tmp = (x * y) / z; elseif (z <= 82000.0) tmp = (x * t) / (z + -1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.2e+17], t$95$1, If[LessEqual[z, 7.6e-272], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e-44], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 82000.0], N[(N[(x * t), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{y + t}}\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-272}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-44}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 82000:\\
\;\;\;\;\frac{x \cdot t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -9.2e17 or 82000 < z Initial program 94.5%
Taylor expanded in z around inf 83.5%
associate-/l*94.5%
cancel-sign-sub-inv94.5%
metadata-eval94.5%
*-lft-identity94.5%
+-commutative94.5%
Simplified94.5%
if -9.2e17 < z < 7.5999999999999994e-272Initial program 94.9%
Taylor expanded in z around 0 88.9%
+-commutative88.9%
associate-*r/90.8%
*-commutative90.8%
associate-*r*90.8%
neg-mul-190.8%
distribute-rgt-out94.7%
unsub-neg94.7%
Simplified94.7%
if 7.5999999999999994e-272 < z < 1.14999999999999999e-44Initial program 75.8%
Taylor expanded in y around inf 88.8%
if 1.14999999999999999e-44 < z < 82000Initial program 99.9%
Taylor expanded in y around 0 82.5%
associate-*r/82.5%
associate-*r*82.5%
neg-mul-182.5%
associate-*l/82.4%
*-commutative82.4%
distribute-frac-neg82.4%
mul-1-neg82.4%
associate-*r/82.4%
*-commutative82.4%
associate-*r/82.2%
metadata-eval82.2%
associate-/r*82.2%
neg-mul-182.2%
associate-*r/82.4%
*-rgt-identity82.4%
neg-sub082.4%
associate--r-82.4%
metadata-eval82.4%
Simplified82.4%
Taylor expanded in x around 0 82.5%
Final simplification93.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ t (- 1.0 z)))) (if (<= x 1.3e-48) (- (/ y (/ z x)) (* x t_1)) (* x (- (/ y z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = t / (1.0 - z);
double tmp;
if (x <= 1.3e-48) {
tmp = (y / (z / x)) - (x * t_1);
} else {
tmp = x * ((y / z) - 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 = t / (1.0d0 - z)
if (x <= 1.3d-48) then
tmp = (y / (z / x)) - (x * t_1)
else
tmp = x * ((y / z) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t / (1.0 - z);
double tmp;
if (x <= 1.3e-48) {
tmp = (y / (z / x)) - (x * t_1);
} else {
tmp = x * ((y / z) - t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = t / (1.0 - z) tmp = 0 if x <= 1.3e-48: tmp = (y / (z / x)) - (x * t_1) else: tmp = x * ((y / z) - t_1) return tmp
function code(x, y, z, t) t_1 = Float64(t / Float64(1.0 - z)) tmp = 0.0 if (x <= 1.3e-48) tmp = Float64(Float64(y / Float64(z / x)) - Float64(x * t_1)); else tmp = Float64(x * Float64(Float64(y / z) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t / (1.0 - z); tmp = 0.0; if (x <= 1.3e-48) tmp = (y / (z / x)) - (x * t_1); else tmp = x * ((y / z) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.3e-48], N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] - N[(x * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{1 - z}\\
\mathbf{if}\;x \leq 1.3 \cdot 10^{-48}:\\
\;\;\;\;\frac{y}{\frac{z}{x}} - x \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t_1\right)\\
\end{array}
\end{array}
if x < 1.29999999999999994e-48Initial program 90.8%
sub-neg90.8%
distribute-rgt-in90.3%
distribute-neg-frac90.3%
Applied egg-rr90.3%
associate-*l/91.7%
associate-/l*94.5%
Applied egg-rr94.5%
if 1.29999999999999994e-48 < x Initial program 93.8%
Final simplification94.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -7.4e+137) (not (<= t 9.8e+128))) (* x (/ t (+ z -1.0))) (* y (/ x z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.4e+137) || !(t <= 9.8e+128)) {
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 <= (-7.4d+137)) .or. (.not. (t <= 9.8d+128))) 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 <= -7.4e+137) || !(t <= 9.8e+128)) {
tmp = x * (t / (z + -1.0));
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -7.4e+137) or not (t <= 9.8e+128): tmp = x * (t / (z + -1.0)) else: tmp = y * (x / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -7.4e+137) || !(t <= 9.8e+128)) tmp = Float64(x * Float64(t / Float64(z + -1.0))); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -7.4e+137) || ~((t <= 9.8e+128))) 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, -7.4e+137], N[Not[LessEqual[t, 9.8e+128]], $MachinePrecision]], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.4 \cdot 10^{+137} \lor \neg \left(t \leq 9.8 \cdot 10^{+128}\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if t < -7.40000000000000041e137 or 9.80000000000000035e128 < t Initial program 95.3%
Taylor expanded in y around 0 69.0%
associate-*r/69.0%
associate-*r*69.0%
neg-mul-169.0%
associate-*l/79.7%
*-commutative79.7%
distribute-frac-neg79.7%
mul-1-neg79.7%
associate-*r/79.7%
*-commutative79.7%
associate-*r/79.6%
metadata-eval79.6%
associate-/r*79.6%
neg-mul-179.6%
associate-*r/79.7%
*-rgt-identity79.7%
neg-sub079.7%
associate--r-79.7%
metadata-eval79.7%
Simplified79.7%
if -7.40000000000000041e137 < t < 9.80000000000000035e128Initial program 90.6%
Taylor expanded in y around inf 75.3%
associate-/l*75.8%
associate-/r/79.4%
Simplified79.4%
Final simplification79.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.22e+125) (not (<= t 1.65e+129))) (* x (/ t z)) (* x (/ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.22e+125) || !(t <= 1.65e+129)) {
tmp = x * (t / z);
} else {
tmp = x * (y / 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 <= (-1.22d+125)) .or. (.not. (t <= 1.65d+129))) then
tmp = x * (t / z)
else
tmp = x * (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.22e+125) || !(t <= 1.65e+129)) {
tmp = x * (t / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.22e+125) or not (t <= 1.65e+129): tmp = x * (t / z) else: tmp = x * (y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.22e+125) || !(t <= 1.65e+129)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.22e+125) || ~((t <= 1.65e+129))) tmp = x * (t / z); else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.22e+125], N[Not[LessEqual[t, 1.65e+129]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{+125} \lor \neg \left(t \leq 1.65 \cdot 10^{+129}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if t < -1.22e125 or 1.64999999999999995e129 < t Initial program 94.1%
Taylor expanded in y around 0 67.9%
associate-*r/67.9%
associate-*r*67.9%
neg-mul-167.9%
associate-*l/78.0%
*-commutative78.0%
distribute-frac-neg78.0%
mul-1-neg78.0%
associate-*r/78.0%
*-commutative78.0%
associate-*r/77.9%
metadata-eval77.9%
associate-/r*77.9%
neg-mul-177.9%
associate-*r/78.0%
*-rgt-identity78.0%
neg-sub078.0%
associate--r-78.0%
metadata-eval78.0%
Simplified78.0%
Taylor expanded in x around 0 67.9%
Taylor expanded in z around inf 54.0%
associate-/l*52.7%
associate-/r/63.9%
Simplified63.9%
if -1.22e125 < t < 1.64999999999999995e129Initial program 90.9%
Taylor expanded in y around inf 75.8%
associate-*r/76.4%
Simplified76.4%
Final simplification73.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.7e+141) (not (<= t 1.9e+129))) (* x (/ t z)) (* y (/ x z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.7e+141) || !(t <= 1.9e+129)) {
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 <= (-1.7d+141)) .or. (.not. (t <= 1.9d+129))) 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 <= -1.7e+141) || !(t <= 1.9e+129)) {
tmp = x * (t / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.7e+141) or not (t <= 1.9e+129): tmp = x * (t / z) else: tmp = y * (x / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.7e+141) || !(t <= 1.9e+129)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.7e+141) || ~((t <= 1.9e+129))) tmp = x * (t / z); else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.7e+141], N[Not[LessEqual[t, 1.9e+129]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+141} \lor \neg \left(t \leq 1.9 \cdot 10^{+129}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if t < -1.6999999999999999e141 or 1.90000000000000003e129 < t Initial program 95.3%
Taylor expanded in y around 0 69.0%
associate-*r/69.0%
associate-*r*69.0%
neg-mul-169.0%
associate-*l/79.7%
*-commutative79.7%
distribute-frac-neg79.7%
mul-1-neg79.7%
associate-*r/79.7%
*-commutative79.7%
associate-*r/79.6%
metadata-eval79.6%
associate-/r*79.6%
neg-mul-179.6%
associate-*r/79.7%
*-rgt-identity79.7%
neg-sub079.7%
associate--r-79.7%
metadata-eval79.7%
Simplified79.7%
Taylor expanded in x around 0 69.0%
Taylor expanded in z around inf 55.1%
associate-/l*55.1%
associate-/r/65.7%
Simplified65.7%
if -1.6999999999999999e141 < t < 1.90000000000000003e129Initial program 90.6%
Taylor expanded in y around inf 75.3%
associate-/l*75.8%
associate-/r/79.4%
Simplified79.4%
Final simplification76.1%
(FPCore (x y z t) :precision binary64 (* x (/ y z)))
double code(double x, double y, double z, double t) {
return x * (y / 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)
end function
public static double code(double x, double y, double z, double t) {
return x * (y / z);
}
def code(x, y, z, t): return x * (y / z)
function code(x, y, z, t) return Float64(x * Float64(y / z)) end
function tmp = code(x, y, z, t) tmp = x * (y / z); end
code[x_, y_, z_, t_] := N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y}{z}
\end{array}
Initial program 91.7%
Taylor expanded in y around inf 64.7%
associate-*r/63.6%
Simplified63.6%
Final simplification63.6%
(FPCore (x y z t) :precision binary64 (* x (- t)))
double code(double x, double y, double z, double t) {
return x * -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 = x * -t
end function
public static double code(double x, double y, double z, double t) {
return x * -t;
}
def code(x, y, z, t): return x * -t
function code(x, y, z, t) return Float64(x * Float64(-t)) end
function tmp = code(x, y, z, t) tmp = x * -t; end
code[x_, y_, z_, t_] := N[(x * (-t)), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(-t\right)
\end{array}
Initial program 91.7%
Taylor expanded in y around 0 38.8%
associate-*r/38.8%
associate-*r*38.8%
neg-mul-138.8%
associate-*l/41.4%
*-commutative41.4%
distribute-frac-neg41.4%
mul-1-neg41.4%
associate-*r/41.4%
*-commutative41.4%
associate-*r/41.4%
metadata-eval41.4%
associate-/r*41.4%
neg-mul-141.4%
associate-*r/41.4%
*-rgt-identity41.4%
neg-sub041.4%
associate--r-41.4%
metadata-eval41.4%
Simplified41.4%
Taylor expanded in x around 0 38.8%
Taylor expanded in z around 0 20.0%
mul-1-neg20.0%
*-commutative20.0%
Simplified20.0%
Final simplification20.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 2024021
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:herbie-target
(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)))))