
(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 16 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 (* 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}
Initial program 96.1%
Final simplification96.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2150000000.0) (not (<= z 1.0))) (/ x (/ z (+ y t))) (* x (- (/ y z) (+ t (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2150000000.0) || !(z <= 1.0)) {
tmp = x / (z / (y + t));
} 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 <= (-2150000000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x / (z / (y + t))
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 <= -2150000000.0) || !(z <= 1.0)) {
tmp = x / (z / (y + t));
} else {
tmp = x * ((y / z) - (t + (z * t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2150000000.0) or not (z <= 1.0): tmp = x / (z / (y + t)) else: tmp = x * ((y / z) - (t + (z * t))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2150000000.0) || !(z <= 1.0)) tmp = Float64(x / Float64(z / Float64(y + t))); 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 <= -2150000000.0) || ~((z <= 1.0))) tmp = x / (z / (y + t)); else tmp = x * ((y / z) - (t + (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2150000000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x / N[(z / N[(y + t), $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 -2150000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{\frac{z}{y + t}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - \left(t + z \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -2.15e9 or 1 < z Initial program 97.8%
Taylor expanded in z around inf 88.5%
*-commutative88.5%
associate-/l*96.7%
neg-mul-196.7%
Simplified96.7%
if -2.15e9 < z < 1Initial program 93.9%
Taylor expanded in z around 0 93.5%
*-commutative93.5%
Simplified93.5%
Final simplification95.4%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -1.0)
(and (not (<= z -1.4e-270)) (or (<= z 1.2e-254) (not (<= z 1.0)))))
(* t (/ x z))
(* x (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || (!(z <= -1.4e-270) && ((z <= 1.2e-254) || !(z <= 1.0)))) {
tmp = t * (x / z);
} else {
tmp = x * -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 <= (-1.0d0)) .or. (.not. (z <= (-1.4d-270))) .and. (z <= 1.2d-254) .or. (.not. (z <= 1.0d0))) then
tmp = t * (x / z)
else
tmp = x * -t
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.4e-270) && ((z <= 1.2e-254) || !(z <= 1.0)))) {
tmp = t * (x / z);
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or (not (z <= -1.4e-270) and ((z <= 1.2e-254) or not (z <= 1.0))): tmp = t * (x / z) else: tmp = x * -t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || (!(z <= -1.4e-270) && ((z <= 1.2e-254) || !(z <= 1.0)))) tmp = Float64(t * Float64(x / z)); else tmp = Float64(x * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || (~((z <= -1.4e-270)) && ((z <= 1.2e-254) || ~((z <= 1.0))))) tmp = t * (x / z); else tmp = x * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], And[N[Not[LessEqual[z, -1.4e-270]], $MachinePrecision], Or[LessEqual[z, 1.2e-254], N[Not[LessEqual[z, 1.0]], $MachinePrecision]]]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq -1.4 \cdot 10^{-270}\right) \land \left(z \leq 1.2 \cdot 10^{-254} \lor \neg \left(z \leq 1\right)\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -1 or -1.4e-270 < z < 1.20000000000000001e-254 or 1 < z Initial program 96.4%
Taylor expanded in z around inf 85.2%
*-commutative85.2%
associate-/l*91.4%
neg-mul-191.4%
Simplified91.4%
Taylor expanded in y around 0 58.0%
associate-*r/60.1%
Simplified60.1%
if -1 < z < -1.4e-270 or 1.20000000000000001e-254 < z < 1Initial program 95.6%
Taylor expanded in y around 0 40.0%
associate-*r/40.0%
associate-*r*40.0%
neg-mul-140.0%
associate-*l/40.0%
*-commutative40.0%
distribute-frac-neg40.0%
neg-mul-140.0%
metadata-eval40.0%
times-frac40.0%
*-lft-identity40.0%
neg-mul-140.0%
sub-neg40.0%
+-commutative40.0%
distribute-neg-in40.0%
remove-double-neg40.0%
metadata-eval40.0%
Simplified40.0%
Taylor expanded in z around 0 38.7%
associate-*r*38.7%
mul-1-neg38.7%
Simplified38.7%
Final simplification52.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.15e+25)
(/ y (/ z x))
(if (or (<= y 1.5e-181) (and (not (<= y 4.2e-134)) (<= y 2e-91)))
(/ x (/ z t))
(/ (* x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.15e+25) {
tmp = y / (z / x);
} else if ((y <= 1.5e-181) || (!(y <= 4.2e-134) && (y <= 2e-91))) {
tmp = x / (z / t);
} 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 (y <= (-1.15d+25)) then
tmp = y / (z / x)
else if ((y <= 1.5d-181) .or. (.not. (y <= 4.2d-134)) .and. (y <= 2d-91)) then
tmp = x / (z / t)
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 (y <= -1.15e+25) {
tmp = y / (z / x);
} else if ((y <= 1.5e-181) || (!(y <= 4.2e-134) && (y <= 2e-91))) {
tmp = x / (z / t);
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.15e+25: tmp = y / (z / x) elif (y <= 1.5e-181) or (not (y <= 4.2e-134) and (y <= 2e-91)): tmp = x / (z / t) else: tmp = (x * y) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.15e+25) tmp = Float64(y / Float64(z / x)); elseif ((y <= 1.5e-181) || (!(y <= 4.2e-134) && (y <= 2e-91))) tmp = Float64(x / Float64(z / t)); else tmp = Float64(Float64(x * y) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.15e+25) tmp = y / (z / x); elseif ((y <= 1.5e-181) || (~((y <= 4.2e-134)) && (y <= 2e-91))) tmp = x / (z / t); else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.15e+25], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.5e-181], And[N[Not[LessEqual[y, 4.2e-134]], $MachinePrecision], LessEqual[y, 2e-91]]], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+25}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-181} \lor \neg \left(y \leq 4.2 \cdot 10^{-134}\right) \land y \leq 2 \cdot 10^{-91}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if y < -1.1499999999999999e25Initial program 94.2%
Taylor expanded in y around inf 80.5%
associate-*l/84.4%
Simplified84.4%
associate-/r/85.6%
Applied egg-rr85.6%
if -1.1499999999999999e25 < y < 1.49999999999999987e-181 or 4.1999999999999998e-134 < y < 2.00000000000000004e-91Initial program 98.1%
Taylor expanded in z around inf 66.0%
*-commutative66.0%
associate-/l*71.7%
neg-mul-171.7%
Simplified71.7%
Taylor expanded in y around 0 67.7%
if 1.49999999999999987e-181 < y < 4.1999999999999998e-134 or 2.00000000000000004e-91 < y Initial program 94.7%
Taylor expanded in y around inf 77.8%
Final simplification74.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))) (t_2 (* x (- t))))
(if (<= z -1.0)
t_1
(if (<= z -1.35e-271)
t_2
(if (<= z 2.4e-254) (* t (/ x z)) (if (<= z 0.78) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double t_2 = x * -t;
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= -1.35e-271) {
tmp = t_2;
} else if (z <= 2.4e-254) {
tmp = t * (x / z);
} else if (z <= 0.78) {
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 = x * (t / z)
t_2 = x * -t
if (z <= (-1.0d0)) then
tmp = t_1
else if (z <= (-1.35d-271)) then
tmp = t_2
else if (z <= 2.4d-254) then
tmp = t * (x / z)
else if (z <= 0.78d0) 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 = x * (t / z);
double t_2 = x * -t;
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= -1.35e-271) {
tmp = t_2;
} else if (z <= 2.4e-254) {
tmp = t * (x / z);
} else if (z <= 0.78) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) t_2 = x * -t tmp = 0 if z <= -1.0: tmp = t_1 elif z <= -1.35e-271: tmp = t_2 elif z <= 2.4e-254: tmp = t * (x / z) elif z <= 0.78: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) t_2 = Float64(x * Float64(-t)) tmp = 0.0 if (z <= -1.0) tmp = t_1; elseif (z <= -1.35e-271) tmp = t_2; elseif (z <= 2.4e-254) tmp = Float64(t * Float64(x / z)); elseif (z <= 0.78) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); t_2 = x * -t; tmp = 0.0; if (z <= -1.0) tmp = t_1; elseif (z <= -1.35e-271) tmp = t_2; elseif (z <= 2.4e-254) tmp = t * (x / z); elseif (z <= 0.78) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * (-t)), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$1, If[LessEqual[z, -1.35e-271], t$95$2, If[LessEqual[z, 2.4e-254], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.78], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
t_2 := x \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-271}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-254}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 0.78:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1 or 0.78000000000000003 < z Initial program 97.8%
Taylor expanded in y around 0 64.1%
associate-*r/64.1%
associate-*r*64.1%
neg-mul-164.1%
associate-*l/69.8%
*-commutative69.8%
distribute-frac-neg69.8%
neg-mul-169.8%
metadata-eval69.8%
times-frac69.8%
*-lft-identity69.8%
neg-mul-169.8%
sub-neg69.8%
+-commutative69.8%
distribute-neg-in69.8%
remove-double-neg69.8%
metadata-eval69.8%
Simplified69.8%
Taylor expanded in z around inf 68.7%
if -1 < z < -1.3499999999999999e-271 or 2.40000000000000002e-254 < z < 0.78000000000000003Initial program 95.6%
Taylor expanded in y around 0 40.0%
associate-*r/40.0%
associate-*r*40.0%
neg-mul-140.0%
associate-*l/40.0%
*-commutative40.0%
distribute-frac-neg40.0%
neg-mul-140.0%
metadata-eval40.0%
times-frac40.0%
*-lft-identity40.0%
neg-mul-140.0%
sub-neg40.0%
+-commutative40.0%
distribute-neg-in40.0%
remove-double-neg40.0%
metadata-eval40.0%
Simplified40.0%
Taylor expanded in z around 0 38.7%
associate-*r*38.7%
mul-1-neg38.7%
Simplified38.7%
if -1.3499999999999999e-271 < z < 2.40000000000000002e-254Initial program 85.4%
Taylor expanded in z around inf 59.7%
*-commutative59.7%
associate-/l*50.1%
neg-mul-150.1%
Simplified50.1%
Taylor expanded in y around 0 19.0%
associate-*r/24.2%
Simplified24.2%
Final simplification54.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.2e+41) (not (<= z 1.2e+22))) (/ x (/ z t)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.2e+41) || !(z <= 1.2e+22)) {
tmp = x / (z / t);
} 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 <= (-6.2d+41)) .or. (.not. (z <= 1.2d+22))) then
tmp = x / (z / t)
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 <= -6.2e+41) || !(z <= 1.2e+22)) {
tmp = x / (z / t);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6.2e+41) or not (z <= 1.2e+22): tmp = x / (z / t) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.2e+41) || !(z <= 1.2e+22)) tmp = Float64(x / Float64(z / t)); 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 <= -6.2e+41) || ~((z <= 1.2e+22))) tmp = x / (z / t); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.2e+41], N[Not[LessEqual[z, 1.2e+22]], $MachinePrecision]], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+41} \lor \neg \left(z \leq 1.2 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -6.2e41 or 1.2e22 < z Initial program 97.6%
Taylor expanded in z around inf 89.2%
*-commutative89.2%
associate-/l*97.6%
neg-mul-197.6%
Simplified97.6%
Taylor expanded in y around 0 72.3%
if -6.2e41 < z < 1.2e22Initial program 94.6%
Taylor expanded in z around 0 86.6%
mul-1-neg86.6%
unsub-neg86.6%
associate-*l/87.4%
distribute-rgt-out--89.0%
Simplified89.0%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2150000000.0) (not (<= z 1.0))) (* (+ y t) (/ x z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2150000000.0) || !(z <= 1.0)) {
tmp = (y + t) * (x / 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 <= (-2150000000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (y + t) * (x / 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 <= -2150000000.0) || !(z <= 1.0)) {
tmp = (y + t) * (x / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2150000000.0) or not (z <= 1.0): tmp = (y + t) * (x / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2150000000.0) || !(z <= 1.0)) tmp = Float64(Float64(y + t) * Float64(x / 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 <= -2150000000.0) || ~((z <= 1.0))) tmp = (y + t) * (x / z); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2150000000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(y + t), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2150000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\left(y + t\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -2.15e9 or 1 < z Initial program 97.8%
Taylor expanded in z around inf 88.5%
*-commutative88.5%
associate-/l*96.7%
associate-/r/87.3%
cancel-sign-sub-inv87.3%
metadata-eval87.3%
*-lft-identity87.3%
Simplified87.3%
if -2.15e9 < z < 1Initial program 93.9%
Taylor expanded in z around 0 90.9%
mul-1-neg90.9%
unsub-neg90.9%
associate-*l/91.0%
distribute-rgt-out--92.8%
Simplified92.8%
Final simplification89.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2150000000.0) (not (<= z 1.0))) (/ x (/ z (+ y t))) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2150000000.0) || !(z <= 1.0)) {
tmp = x / (z / (y + t));
} 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 <= (-2150000000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x / (z / (y + t))
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 <= -2150000000.0) || !(z <= 1.0)) {
tmp = x / (z / (y + t));
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2150000000.0) or not (z <= 1.0): tmp = x / (z / (y + t)) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2150000000.0) || !(z <= 1.0)) tmp = Float64(x / Float64(z / Float64(y + t))); 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 <= -2150000000.0) || ~((z <= 1.0))) tmp = x / (z / (y + t)); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2150000000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x / N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2150000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{\frac{z}{y + t}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -2.15e9 or 1 < z Initial program 97.8%
Taylor expanded in z around inf 88.5%
*-commutative88.5%
associate-/l*96.7%
neg-mul-196.7%
Simplified96.7%
if -2.15e9 < z < 1Initial program 93.9%
Taylor expanded in z around 0 90.9%
mul-1-neg90.9%
unsub-neg90.9%
associate-*l/91.0%
distribute-rgt-out--92.8%
Simplified92.8%
Final simplification95.1%
(FPCore (x y z t) :precision binary64 (if (<= y -3.2e+28) (/ y (/ z x)) (if (<= y 2.1e-95) (* t (/ x (+ z -1.0))) (/ (* x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.2e+28) {
tmp = y / (z / x);
} else if (y <= 2.1e-95) {
tmp = t * (x / (z + -1.0));
} 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 (y <= (-3.2d+28)) then
tmp = y / (z / x)
else if (y <= 2.1d-95) then
tmp = t * (x / (z + (-1.0d0)))
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 (y <= -3.2e+28) {
tmp = y / (z / x);
} else if (y <= 2.1e-95) {
tmp = t * (x / (z + -1.0));
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.2e+28: tmp = y / (z / x) elif y <= 2.1e-95: tmp = t * (x / (z + -1.0)) else: tmp = (x * y) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.2e+28) tmp = Float64(y / Float64(z / x)); elseif (y <= 2.1e-95) tmp = Float64(t * Float64(x / Float64(z + -1.0))); else tmp = Float64(Float64(x * y) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.2e+28) tmp = y / (z / x); elseif (y <= 2.1e-95) tmp = t * (x / (z + -1.0)); else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.2e+28], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-95], N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+28}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-95}:\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if y < -3.2e28Initial program 94.1%
Taylor expanded in y around inf 82.1%
associate-*l/86.1%
Simplified86.1%
associate-/r/87.4%
Applied egg-rr87.4%
if -3.2e28 < y < 2.1e-95Initial program 97.6%
Taylor expanded in y around 0 75.2%
associate-*r/75.2%
associate-*r*75.2%
neg-mul-175.2%
associate-*l/80.1%
*-commutative80.1%
distribute-frac-neg80.1%
neg-mul-180.1%
metadata-eval80.1%
times-frac80.1%
*-lft-identity80.1%
neg-mul-180.1%
sub-neg80.1%
+-commutative80.1%
distribute-neg-in80.1%
remove-double-neg80.1%
metadata-eval80.1%
Simplified80.1%
Taylor expanded in x around 0 75.2%
sub-neg75.2%
metadata-eval75.2%
associate-*r/78.6%
Simplified78.6%
if 2.1e-95 < y Initial program 94.9%
Taylor expanded in y around inf 79.9%
Final simplification80.6%
(FPCore (x y z t) :precision binary64 (if (<= z -3.3e+43) (/ x (/ z t)) (if (<= z 1.65e-10) (* x (- (/ y z) t)) (* x (/ t (+ z -1.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.3e+43) {
tmp = x / (z / t);
} else if (z <= 1.65e-10) {
tmp = x * ((y / z) - t);
} else {
tmp = x * (t / (z + -1.0));
}
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 <= (-3.3d+43)) then
tmp = x / (z / t)
else if (z <= 1.65d-10) then
tmp = x * ((y / z) - t)
else
tmp = x * (t / (z + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.3e+43) {
tmp = x / (z / t);
} else if (z <= 1.65e-10) {
tmp = x * ((y / z) - t);
} else {
tmp = x * (t / (z + -1.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.3e+43: tmp = x / (z / t) elif z <= 1.65e-10: tmp = x * ((y / z) - t) else: tmp = x * (t / (z + -1.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.3e+43) tmp = Float64(x / Float64(z / t)); elseif (z <= 1.65e-10) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(x * Float64(t / Float64(z + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.3e+43) tmp = x / (z / t); elseif (z <= 1.65e-10) tmp = x * ((y / z) - t); else tmp = x * (t / (z + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.3e+43], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-10], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+43}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-10}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\end{array}
\end{array}
if z < -3.3000000000000001e43Initial program 96.9%
Taylor expanded in z around inf 88.4%
*-commutative88.4%
associate-/l*96.9%
neg-mul-196.9%
Simplified96.9%
Taylor expanded in y around 0 67.8%
if -3.3000000000000001e43 < z < 1.65e-10Initial program 94.3%
Taylor expanded in z around 0 89.6%
mul-1-neg89.6%
unsub-neg89.6%
associate-*l/89.7%
distribute-rgt-out--91.4%
Simplified91.4%
if 1.65e-10 < z Initial program 98.4%
Taylor expanded in y around 0 69.8%
associate-*r/69.8%
associate-*r*69.8%
neg-mul-169.8%
associate-*l/74.8%
*-commutative74.8%
distribute-frac-neg74.8%
neg-mul-174.8%
metadata-eval74.8%
times-frac74.8%
*-lft-identity74.8%
neg-mul-174.8%
sub-neg74.8%
+-commutative74.8%
distribute-neg-in74.8%
remove-double-neg74.8%
metadata-eval74.8%
Simplified74.8%
Final simplification80.6%
(FPCore (x y z t) :precision binary64 (if (<= z -2150000000.0) (/ (* x (+ y t)) z) (if (<= z 1.0) (* x (- (/ y z) t)) (* (+ y t) (/ x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2150000000.0) {
tmp = (x * (y + t)) / z;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (y + t) * (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 (z <= (-2150000000.0d0)) then
tmp = (x * (y + t)) / z
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
else
tmp = (y + t) * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2150000000.0) {
tmp = (x * (y + t)) / z;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (y + t) * (x / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2150000000.0: tmp = (x * (y + t)) / z elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = (y + t) * (x / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2150000000.0) tmp = Float64(Float64(x * Float64(y + t)) / z); elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(Float64(y + t) * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2150000000.0) tmp = (x * (y + t)) / z; elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = (y + t) * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2150000000.0], N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(y + t), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2150000000:\\
\;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + t\right) \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -2.15e9Initial program 97.2%
Taylor expanded in z around inf 89.5%
*-commutative89.5%
associate-/l*97.2%
neg-mul-197.2%
Simplified97.2%
Taylor expanded in x around 0 89.5%
if -2.15e9 < z < 1Initial program 93.9%
Taylor expanded in z around 0 90.9%
mul-1-neg90.9%
unsub-neg90.9%
associate-*l/91.0%
distribute-rgt-out--92.8%
Simplified92.8%
if 1 < z Initial program 98.4%
Taylor expanded in z around inf 87.3%
*-commutative87.3%
associate-/l*96.2%
associate-/r/88.5%
cancel-sign-sub-inv88.5%
metadata-eval88.5%
*-lft-identity88.5%
Simplified88.5%
Final simplification90.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.25e+25) (not (<= y 1.95e-78))) (* x (/ y z)) (* x (/ t z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.25e+25) || !(y <= 1.95e-78)) {
tmp = x * (y / z);
} 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 ((y <= (-1.25d+25)) .or. (.not. (y <= 1.95d-78))) then
tmp = x * (y / z)
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 ((y <= -1.25e+25) || !(y <= 1.95e-78)) {
tmp = x * (y / z);
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.25e+25) or not (y <= 1.95e-78): tmp = x * (y / z) else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.25e+25) || !(y <= 1.95e-78)) tmp = Float64(x * Float64(y / z)); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.25e+25) || ~((y <= 1.95e-78))) tmp = x * (y / z); else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.25e+25], N[Not[LessEqual[y, 1.95e-78]], $MachinePrecision]], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+25} \lor \neg \left(y \leq 1.95 \cdot 10^{-78}\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if y < -1.25000000000000006e25 or 1.9500000000000001e-78 < y Initial program 94.6%
Taylor expanded in y around inf 80.7%
associate-*l/80.0%
Simplified80.0%
if -1.25000000000000006e25 < y < 1.9500000000000001e-78Initial program 97.6%
Taylor expanded in y around 0 75.2%
associate-*r/75.2%
associate-*r*75.2%
neg-mul-175.2%
associate-*l/80.1%
*-commutative80.1%
distribute-frac-neg80.1%
neg-mul-180.1%
metadata-eval80.1%
times-frac80.1%
*-lft-identity80.1%
neg-mul-180.1%
sub-neg80.1%
+-commutative80.1%
distribute-neg-in80.1%
remove-double-neg80.1%
metadata-eval80.1%
Simplified80.1%
Taylor expanded in z around inf 63.5%
Final simplification71.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.15e+25) (not (<= y 3.1e-65))) (* x (/ y z)) (/ x (/ z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.15e+25) || !(y <= 3.1e-65)) {
tmp = x * (y / z);
} else {
tmp = x / (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 ((y <= (-1.15d+25)) .or. (.not. (y <= 3.1d-65))) then
tmp = x * (y / z)
else
tmp = x / (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.15e+25) || !(y <= 3.1e-65)) {
tmp = x * (y / z);
} else {
tmp = x / (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.15e+25) or not (y <= 3.1e-65): tmp = x * (y / z) else: tmp = x / (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.15e+25) || !(y <= 3.1e-65)) tmp = Float64(x * Float64(y / z)); else tmp = Float64(x / Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.15e+25) || ~((y <= 3.1e-65))) tmp = x * (y / z); else tmp = x / (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.15e+25], N[Not[LessEqual[y, 3.1e-65]], $MachinePrecision]], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+25} \lor \neg \left(y \leq 3.1 \cdot 10^{-65}\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\end{array}
\end{array}
if y < -1.1499999999999999e25 or 3.10000000000000016e-65 < y Initial program 94.6%
Taylor expanded in y around inf 80.7%
associate-*l/80.0%
Simplified80.0%
if -1.1499999999999999e25 < y < 3.10000000000000016e-65Initial program 97.6%
Taylor expanded in z around inf 65.0%
*-commutative65.0%
associate-/l*70.0%
neg-mul-170.0%
Simplified70.0%
Taylor expanded in y around 0 63.6%
Final simplification71.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.6e+27) (not (<= y 2.3e-62))) (/ x (/ z y)) (/ x (/ z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.6e+27) || !(y <= 2.3e-62)) {
tmp = x / (z / y);
} else {
tmp = x / (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 ((y <= (-1.6d+27)) .or. (.not. (y <= 2.3d-62))) then
tmp = x / (z / y)
else
tmp = x / (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.6e+27) || !(y <= 2.3e-62)) {
tmp = x / (z / y);
} else {
tmp = x / (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.6e+27) or not (y <= 2.3e-62): tmp = x / (z / y) else: tmp = x / (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.6e+27) || !(y <= 2.3e-62)) tmp = Float64(x / Float64(z / y)); else tmp = Float64(x / Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.6e+27) || ~((y <= 2.3e-62))) tmp = x / (z / y); else tmp = x / (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.6e+27], N[Not[LessEqual[y, 2.3e-62]], $MachinePrecision]], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+27} \lor \neg \left(y \leq 2.3 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\end{array}
\end{array}
if y < -1.60000000000000008e27 or 2.3e-62 < y Initial program 94.6%
Taylor expanded in y around inf 80.7%
*-commutative80.7%
associate-/l*80.2%
Simplified80.2%
if -1.60000000000000008e27 < y < 2.3e-62Initial program 97.6%
Taylor expanded in z around inf 65.0%
*-commutative65.0%
associate-/l*70.0%
neg-mul-170.0%
Simplified70.0%
Taylor expanded in y around 0 63.6%
Final simplification71.6%
(FPCore (x y z t) :precision binary64 (if (<= y -1.1e+25) (/ y (/ z x)) (if (<= y 6.6e-69) (/ x (/ z t)) (/ x (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e+25) {
tmp = y / (z / x);
} else if (y <= 6.6e-69) {
tmp = x / (z / t);
} 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 (y <= (-1.1d+25)) then
tmp = y / (z / x)
else if (y <= 6.6d-69) then
tmp = x / (z / t)
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 (y <= -1.1e+25) {
tmp = y / (z / x);
} else if (y <= 6.6e-69) {
tmp = x / (z / t);
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.1e+25: tmp = y / (z / x) elif y <= 6.6e-69: tmp = x / (z / t) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.1e+25) tmp = Float64(y / Float64(z / x)); elseif (y <= 6.6e-69) tmp = Float64(x / Float64(z / t)); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.1e+25) tmp = y / (z / x); elseif (y <= 6.6e-69) tmp = x / (z / t); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.1e+25], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e-69], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+25}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-69}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -1.1e25Initial program 94.2%
Taylor expanded in y around inf 80.5%
associate-*l/84.4%
Simplified84.4%
associate-/r/85.6%
Applied egg-rr85.6%
if -1.1e25 < y < 6.6000000000000001e-69Initial program 97.6%
Taylor expanded in z around inf 65.0%
*-commutative65.0%
associate-/l*70.0%
neg-mul-170.0%
Simplified70.0%
Taylor expanded in y around 0 63.6%
if 6.6000000000000001e-69 < y Initial program 94.8%
Taylor expanded in y around inf 80.9%
*-commutative80.9%
associate-/l*77.4%
Simplified77.4%
Final simplification71.9%
(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 96.1%
Taylor expanded in y around 0 51.2%
associate-*r/51.2%
associate-*r*51.2%
neg-mul-151.2%
associate-*l/54.5%
*-commutative54.5%
distribute-frac-neg54.5%
neg-mul-154.5%
metadata-eval54.5%
times-frac54.5%
*-lft-identity54.5%
neg-mul-154.5%
sub-neg54.5%
+-commutative54.5%
distribute-neg-in54.5%
remove-double-neg54.5%
metadata-eval54.5%
Simplified54.5%
Taylor expanded in z around 0 21.5%
associate-*r*21.5%
mul-1-neg21.5%
Simplified21.5%
Final simplification21.5%
(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 2023238
(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)))))