
(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 11 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))))) (if (<= t_1 5e+300) (* t_1 x) (* y (/ x z)))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= 5e+300) {
tmp = t_1 * x;
} 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) :: t_1
real(8) :: tmp
t_1 = (y / z) - (t / (1.0d0 - z))
if (t_1 <= 5d+300) then
tmp = t_1 * x
else
tmp = y * (x / z)
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 tmp;
if (t_1 <= 5e+300) {
tmp = t_1 * x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= 5e+300: tmp = t_1 * x else: tmp = y * (x / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) tmp = 0.0 if (t_1 <= 5e+300) tmp = Float64(t_1 * x); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) - (t / (1.0 - z)); tmp = 0.0; if (t_1 <= 5e+300) tmp = t_1 * x; else tmp = y * (x / z); 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]}, If[LessEqual[t$95$1, 5e+300], N[(t$95$1 * x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;t_1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 5.00000000000000026e300Initial program 97.5%
if 5.00000000000000026e300 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) Initial program 64.9%
frac-2neg64.9%
div-inv64.9%
fma-neg64.9%
distribute-neg-frac64.9%
Applied egg-rr64.9%
fma-udef64.9%
+-commutative64.9%
distribute-lft-neg-out64.9%
unsub-neg64.9%
neg-mul-164.9%
*-commutative64.9%
associate-*r/64.9%
metadata-eval64.9%
associate-/r*64.9%
neg-mul-164.9%
associate-*r/64.9%
*-rgt-identity64.9%
neg-sub064.9%
associate--r-64.9%
metadata-eval64.9%
neg-mul-164.9%
associate-/r*64.9%
metadata-eval64.9%
Simplified64.9%
Taylor expanded in t around 0 99.8%
associate-*r/100.0%
Simplified100.0%
Final simplification97.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -0.75) (not (<= z 2.8e-13))) (* x (/ (+ y t) z)) (* x (- (/ y z) (+ t (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.75) || !(z <= 2.8e-13)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - (t + (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-0.75d0)) .or. (.not. (z <= 2.8d-13))) then
tmp = x * ((y + t) / z)
else
tmp = x * ((y / z) - (t + (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.75) || !(z <= 2.8e-13)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - (t + (z * t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.75) or not (z <= 2.8e-13): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - (t + (z * t))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.75) || !(z <= 2.8e-13)) tmp = Float64(x * Float64(Float64(y + t) / z)); else tmp = Float64(x * Float64(Float64(y / z) - Float64(t + Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -0.75) || ~((z <= 2.8e-13))) tmp = x * ((y + t) / z); else tmp = x * ((y / z) - (t + (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.75], N[Not[LessEqual[z, 2.8e-13]], $MachinePrecision]], N[(x * N[(N[(y + t), $MachinePrecision] / z), $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 -0.75 \lor \neg \left(z \leq 2.8 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - \left(t + z \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -0.75 or 2.8000000000000002e-13 < z Initial program 98.5%
Taylor expanded in z around inf 87.0%
associate-/l*80.0%
associate-/r/97.7%
cancel-sign-sub-inv97.7%
metadata-eval97.7%
*-lft-identity97.7%
Simplified97.7%
if -0.75 < z < 2.8000000000000002e-13Initial program 92.1%
Taylor expanded in z around 0 92.1%
*-commutative92.1%
Simplified92.1%
Final simplification95.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -1.8e+206)
t_1
(if (<= t 4.8e+95)
(* y (/ x z))
(if (or (<= t 6.5e+260) (not (<= t 8.5e+297))) t_1 (* t (- x)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -1.8e+206) {
tmp = t_1;
} else if (t <= 4.8e+95) {
tmp = y * (x / z);
} else if ((t <= 6.5e+260) || !(t <= 8.5e+297)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (t <= (-1.8d+206)) then
tmp = t_1
else if (t <= 4.8d+95) then
tmp = y * (x / z)
else if ((t <= 6.5d+260) .or. (.not. (t <= 8.5d+297))) then
tmp = t_1
else
tmp = t * -x
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 tmp;
if (t <= -1.8e+206) {
tmp = t_1;
} else if (t <= 4.8e+95) {
tmp = y * (x / z);
} else if ((t <= 6.5e+260) || !(t <= 8.5e+297)) {
tmp = t_1;
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -1.8e+206: tmp = t_1 elif t <= 4.8e+95: tmp = y * (x / z) elif (t <= 6.5e+260) or not (t <= 8.5e+297): tmp = t_1 else: tmp = t * -x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -1.8e+206) tmp = t_1; elseif (t <= 4.8e+95) tmp = Float64(y * Float64(x / z)); elseif ((t <= 6.5e+260) || !(t <= 8.5e+297)) tmp = t_1; else tmp = Float64(t * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -1.8e+206) tmp = t_1; elseif (t <= 4.8e+95) tmp = y * (x / z); elseif ((t <= 6.5e+260) || ~((t <= 8.5e+297))) tmp = t_1; else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.8e+206], t$95$1, If[LessEqual[t, 4.8e+95], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 6.5e+260], N[Not[LessEqual[t, 8.5e+297]], $MachinePrecision]], t$95$1, N[(t * (-x)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{+206}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+95}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+260} \lor \neg \left(t \leq 8.5 \cdot 10^{+297}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if t < -1.80000000000000014e206 or 4.8000000000000001e95 < t < 6.49999999999999954e260 or 8.4999999999999994e297 < t Initial program 96.9%
Taylor expanded in y around 0 66.4%
associate-*r/66.4%
associate-*r*66.4%
neg-mul-166.4%
associate-*l/73.9%
*-commutative73.9%
neg-mul-173.9%
*-commutative73.9%
associate-*r/73.7%
metadata-eval73.7%
associate-/r*73.7%
neg-mul-173.7%
associate-*r/73.9%
*-rgt-identity73.9%
neg-sub073.9%
associate--r-73.9%
metadata-eval73.9%
Simplified73.9%
Taylor expanded in z around inf 71.5%
if -1.80000000000000014e206 < t < 4.8000000000000001e95Initial program 95.8%
frac-2neg95.8%
div-inv95.6%
fma-neg95.6%
distribute-neg-frac95.6%
Applied egg-rr95.6%
fma-udef95.6%
+-commutative95.6%
distribute-lft-neg-out95.6%
unsub-neg95.6%
neg-mul-195.6%
*-commutative95.6%
associate-*r/95.6%
metadata-eval95.6%
associate-/r*95.6%
neg-mul-195.6%
associate-*r/95.6%
*-rgt-identity95.6%
neg-sub095.6%
associate--r-95.6%
metadata-eval95.6%
neg-mul-195.6%
associate-/r*95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in t around 0 73.3%
associate-*r/72.1%
Simplified72.1%
if 6.49999999999999954e260 < t < 8.4999999999999994e297Initial program 81.3%
Taylor expanded in y around 0 80.7%
associate-*r/80.7%
associate-*r*80.7%
neg-mul-180.7%
associate-*l/80.7%
*-commutative80.7%
neg-mul-180.7%
*-commutative80.7%
associate-*r/80.7%
metadata-eval80.7%
associate-/r*80.7%
neg-mul-180.7%
associate-*r/80.7%
*-rgt-identity80.7%
neg-sub080.7%
associate--r-80.7%
metadata-eval80.7%
Simplified80.7%
Taylor expanded in z around 0 71.4%
mul-1-neg71.4%
Simplified71.4%
Final simplification71.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -4.6e+146)
t_1
(if (<= t 1.1e+94)
(* (/ y z) x)
(if (or (<= t 7.5e+260) (not (<= t 5.1e+297))) t_1 (* t (- x)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -4.6e+146) {
tmp = t_1;
} else if (t <= 1.1e+94) {
tmp = (y / z) * x;
} else if ((t <= 7.5e+260) || !(t <= 5.1e+297)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (t <= (-4.6d+146)) then
tmp = t_1
else if (t <= 1.1d+94) then
tmp = (y / z) * x
else if ((t <= 7.5d+260) .or. (.not. (t <= 5.1d+297))) then
tmp = t_1
else
tmp = t * -x
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 tmp;
if (t <= -4.6e+146) {
tmp = t_1;
} else if (t <= 1.1e+94) {
tmp = (y / z) * x;
} else if ((t <= 7.5e+260) || !(t <= 5.1e+297)) {
tmp = t_1;
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -4.6e+146: tmp = t_1 elif t <= 1.1e+94: tmp = (y / z) * x elif (t <= 7.5e+260) or not (t <= 5.1e+297): tmp = t_1 else: tmp = t * -x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -4.6e+146) tmp = t_1; elseif (t <= 1.1e+94) tmp = Float64(Float64(y / z) * x); elseif ((t <= 7.5e+260) || !(t <= 5.1e+297)) tmp = t_1; else tmp = Float64(t * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -4.6e+146) tmp = t_1; elseif (t <= 1.1e+94) tmp = (y / z) * x; elseif ((t <= 7.5e+260) || ~((t <= 5.1e+297))) tmp = t_1; else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.6e+146], t$95$1, If[LessEqual[t, 1.1e+94], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[Or[LessEqual[t, 7.5e+260], N[Not[LessEqual[t, 5.1e+297]], $MachinePrecision]], t$95$1, N[(t * (-x)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -4.6 \cdot 10^{+146}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+94}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+260} \lor \neg \left(t \leq 5.1 \cdot 10^{+297}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if t < -4.60000000000000001e146 or 1.10000000000000006e94 < t < 7.49999999999999947e260 or 5.0999999999999999e297 < t Initial program 95.9%
Taylor expanded in y around 0 66.9%
associate-*r/66.9%
associate-*r*66.9%
neg-mul-166.9%
associate-*l/73.7%
*-commutative73.7%
neg-mul-173.7%
*-commutative73.7%
associate-*r/73.5%
metadata-eval73.5%
associate-/r*73.5%
neg-mul-173.5%
associate-*r/73.7%
*-rgt-identity73.7%
neg-sub073.7%
associate--r-73.7%
metadata-eval73.7%
Simplified73.7%
Taylor expanded in z around inf 68.8%
if -4.60000000000000001e146 < t < 1.10000000000000006e94Initial program 96.1%
Taylor expanded in y around inf 75.0%
associate-*l/78.4%
Simplified78.4%
if 7.49999999999999947e260 < t < 5.0999999999999999e297Initial program 81.3%
Taylor expanded in y around 0 80.7%
associate-*r/80.7%
associate-*r*80.7%
neg-mul-180.7%
associate-*l/80.7%
*-commutative80.7%
neg-mul-180.7%
*-commutative80.7%
associate-*r/80.7%
metadata-eval80.7%
associate-/r*80.7%
neg-mul-180.7%
associate-*r/80.7%
*-rgt-identity80.7%
neg-sub080.7%
associate--r-80.7%
metadata-eval80.7%
Simplified80.7%
Taylor expanded in z around 0 71.4%
mul-1-neg71.4%
Simplified71.4%
Final simplification75.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -8.2e+144)
t_1
(if (<= t 9.5e+92)
(/ x (/ z y))
(if (or (<= t 8.6e+260) (not (<= t 1.82e+297))) t_1 (* t (- x)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -8.2e+144) {
tmp = t_1;
} else if (t <= 9.5e+92) {
tmp = x / (z / y);
} else if ((t <= 8.6e+260) || !(t <= 1.82e+297)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (t <= (-8.2d+144)) then
tmp = t_1
else if (t <= 9.5d+92) then
tmp = x / (z / y)
else if ((t <= 8.6d+260) .or. (.not. (t <= 1.82d+297))) then
tmp = t_1
else
tmp = t * -x
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 tmp;
if (t <= -8.2e+144) {
tmp = t_1;
} else if (t <= 9.5e+92) {
tmp = x / (z / y);
} else if ((t <= 8.6e+260) || !(t <= 1.82e+297)) {
tmp = t_1;
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -8.2e+144: tmp = t_1 elif t <= 9.5e+92: tmp = x / (z / y) elif (t <= 8.6e+260) or not (t <= 1.82e+297): tmp = t_1 else: tmp = t * -x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -8.2e+144) tmp = t_1; elseif (t <= 9.5e+92) tmp = Float64(x / Float64(z / y)); elseif ((t <= 8.6e+260) || !(t <= 1.82e+297)) tmp = t_1; else tmp = Float64(t * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -8.2e+144) tmp = t_1; elseif (t <= 9.5e+92) tmp = x / (z / y); elseif ((t <= 8.6e+260) || ~((t <= 1.82e+297))) tmp = t_1; else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.2e+144], t$95$1, If[LessEqual[t, 9.5e+92], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 8.6e+260], N[Not[LessEqual[t, 1.82e+297]], $MachinePrecision]], t$95$1, N[(t * (-x)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{+144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+92}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;t \leq 8.6 \cdot 10^{+260} \lor \neg \left(t \leq 1.82 \cdot 10^{+297}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if t < -8.20000000000000002e144 or 9.4999999999999995e92 < t < 8.60000000000000048e260 or 1.8199999999999999e297 < t Initial program 95.9%
Taylor expanded in y around 0 66.9%
associate-*r/66.9%
associate-*r*66.9%
neg-mul-166.9%
associate-*l/73.7%
*-commutative73.7%
neg-mul-173.7%
*-commutative73.7%
associate-*r/73.5%
metadata-eval73.5%
associate-/r*73.5%
neg-mul-173.5%
associate-*r/73.7%
*-rgt-identity73.7%
neg-sub073.7%
associate--r-73.7%
metadata-eval73.7%
Simplified73.7%
Taylor expanded in z around inf 68.8%
if -8.20000000000000002e144 < t < 9.4999999999999995e92Initial program 96.1%
Taylor expanded in z around inf 77.3%
*-commutative77.3%
associate-/l*79.9%
neg-mul-179.9%
Simplified79.9%
Taylor expanded in y around inf 79.8%
if 8.60000000000000048e260 < t < 1.8199999999999999e297Initial program 81.3%
Taylor expanded in y around 0 80.7%
associate-*r/80.7%
associate-*r*80.7%
neg-mul-180.7%
associate-*l/80.7%
*-commutative80.7%
neg-mul-180.7%
*-commutative80.7%
associate-*r/80.7%
metadata-eval80.7%
associate-/r*80.7%
neg-mul-180.7%
associate-*r/80.7%
*-rgt-identity80.7%
neg-sub080.7%
associate--r-80.7%
metadata-eval80.7%
Simplified80.7%
Taylor expanded in z around 0 71.4%
mul-1-neg71.4%
Simplified71.4%
Final simplification76.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ y z) x)))
(if (<= z -2.8e+136)
t_1
(if (<= z -12000000000.0)
(* x (/ t z))
(if (<= z 2.85e+35)
(* x (- (/ y z) t))
(if (<= z 6.9e+165) (/ (* t x) z) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) * x;
double tmp;
if (z <= -2.8e+136) {
tmp = t_1;
} else if (z <= -12000000000.0) {
tmp = x * (t / z);
} else if (z <= 2.85e+35) {
tmp = x * ((y / z) - t);
} else if (z <= 6.9e+165) {
tmp = (t * x) / 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 <= (-2.8d+136)) then
tmp = t_1
else if (z <= (-12000000000.0d0)) then
tmp = x * (t / z)
else if (z <= 2.85d+35) then
tmp = x * ((y / z) - t)
else if (z <= 6.9d+165) then
tmp = (t * x) / 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 <= -2.8e+136) {
tmp = t_1;
} else if (z <= -12000000000.0) {
tmp = x * (t / z);
} else if (z <= 2.85e+35) {
tmp = x * ((y / z) - t);
} else if (z <= 6.9e+165) {
tmp = (t * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) * x tmp = 0 if z <= -2.8e+136: tmp = t_1 elif z <= -12000000000.0: tmp = x * (t / z) elif z <= 2.85e+35: tmp = x * ((y / z) - t) elif z <= 6.9e+165: tmp = (t * x) / 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 <= -2.8e+136) tmp = t_1; elseif (z <= -12000000000.0) tmp = Float64(x * Float64(t / z)); elseif (z <= 2.85e+35) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (z <= 6.9e+165) tmp = Float64(Float64(t * x) / 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 <= -2.8e+136) tmp = t_1; elseif (z <= -12000000000.0) tmp = x * (t / z); elseif (z <= 2.85e+35) tmp = x * ((y / z) - t); elseif (z <= 6.9e+165) tmp = (t * x) / 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, -2.8e+136], t$95$1, If[LessEqual[z, -12000000000.0], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.85e+35], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.9e+165], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} \cdot x\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -12000000000:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{+35}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 6.9 \cdot 10^{+165}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.8000000000000002e136 or 6.90000000000000006e165 < z Initial program 97.4%
Taylor expanded in y around inf 67.3%
associate-*l/77.5%
Simplified77.5%
if -2.8000000000000002e136 < z < -1.2e10Initial program 99.7%
Taylor expanded in y around 0 59.2%
associate-*r/59.2%
associate-*r*59.2%
neg-mul-159.2%
associate-*l/65.0%
*-commutative65.0%
neg-mul-165.0%
*-commutative65.0%
associate-*r/64.7%
metadata-eval64.7%
associate-/r*64.7%
neg-mul-164.7%
associate-*r/65.0%
*-rgt-identity65.0%
neg-sub065.0%
associate--r-65.0%
metadata-eval65.0%
Simplified65.0%
Taylor expanded in z around inf 63.5%
if -1.2e10 < z < 2.84999999999999997e35Initial program 92.5%
Taylor expanded in z around 0 89.9%
associate-*l/86.2%
associate-*r*86.2%
neg-mul-186.2%
distribute-rgt-out90.2%
unsub-neg90.2%
Simplified90.2%
if 2.84999999999999997e35 < z < 6.90000000000000006e165Initial program 99.7%
Taylor expanded in y around 0 78.5%
associate-*r/78.5%
associate-*r*78.5%
neg-mul-178.5%
associate-*l/75.0%
*-commutative75.0%
neg-mul-175.0%
*-commutative75.0%
associate-*r/74.9%
metadata-eval74.9%
associate-/r*74.9%
neg-mul-174.9%
associate-*r/75.0%
*-rgt-identity75.0%
neg-sub075.0%
associate--r-75.0%
metadata-eval75.0%
Simplified75.0%
Taylor expanded in z around inf 78.5%
Final simplification82.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ y z) x)))
(if (<= z -1.55e+136)
t_1
(if (<= z -13.0)
(* x (/ t (+ z -1.0)))
(if (<= z 1.65e+35)
(* x (- (/ y z) t))
(if (<= z 1.56e+166) (/ (* t x) z) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) * x;
double tmp;
if (z <= -1.55e+136) {
tmp = t_1;
} else if (z <= -13.0) {
tmp = x * (t / (z + -1.0));
} else if (z <= 1.65e+35) {
tmp = x * ((y / z) - t);
} else if (z <= 1.56e+166) {
tmp = (t * x) / 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 <= (-1.55d+136)) then
tmp = t_1
else if (z <= (-13.0d0)) then
tmp = x * (t / (z + (-1.0d0)))
else if (z <= 1.65d+35) then
tmp = x * ((y / z) - t)
else if (z <= 1.56d+166) then
tmp = (t * x) / 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 <= -1.55e+136) {
tmp = t_1;
} else if (z <= -13.0) {
tmp = x * (t / (z + -1.0));
} else if (z <= 1.65e+35) {
tmp = x * ((y / z) - t);
} else if (z <= 1.56e+166) {
tmp = (t * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) * x tmp = 0 if z <= -1.55e+136: tmp = t_1 elif z <= -13.0: tmp = x * (t / (z + -1.0)) elif z <= 1.65e+35: tmp = x * ((y / z) - t) elif z <= 1.56e+166: tmp = (t * x) / 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 <= -1.55e+136) tmp = t_1; elseif (z <= -13.0) tmp = Float64(x * Float64(t / Float64(z + -1.0))); elseif (z <= 1.65e+35) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (z <= 1.56e+166) tmp = Float64(Float64(t * x) / 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 <= -1.55e+136) tmp = t_1; elseif (z <= -13.0) tmp = x * (t / (z + -1.0)); elseif (z <= 1.65e+35) tmp = x * ((y / z) - t); elseif (z <= 1.56e+166) tmp = (t * x) / 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, -1.55e+136], t$95$1, If[LessEqual[z, -13.0], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+35], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.56e+166], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} \cdot x\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -13:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+35}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 1.56 \cdot 10^{+166}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.54999999999999992e136 or 1.5599999999999999e166 < z Initial program 97.4%
Taylor expanded in y around inf 67.3%
associate-*l/77.5%
Simplified77.5%
if -1.54999999999999992e136 < z < -13Initial program 99.7%
Taylor expanded in y around 0 59.2%
associate-*r/59.2%
associate-*r*59.2%
neg-mul-159.2%
associate-*l/65.0%
*-commutative65.0%
neg-mul-165.0%
*-commutative65.0%
associate-*r/64.7%
metadata-eval64.7%
associate-/r*64.7%
neg-mul-164.7%
associate-*r/65.0%
*-rgt-identity65.0%
neg-sub065.0%
associate--r-65.0%
metadata-eval65.0%
Simplified65.0%
if -13 < z < 1.6500000000000001e35Initial program 92.5%
Taylor expanded in z around 0 89.9%
associate-*l/86.2%
associate-*r*86.2%
neg-mul-186.2%
distribute-rgt-out90.2%
unsub-neg90.2%
Simplified90.2%
if 1.6500000000000001e35 < z < 1.5599999999999999e166Initial program 99.7%
Taylor expanded in y around 0 78.5%
associate-*r/78.5%
associate-*r*78.5%
neg-mul-178.5%
associate-*l/75.0%
*-commutative75.0%
neg-mul-175.0%
*-commutative75.0%
associate-*r/74.9%
metadata-eval74.9%
associate-/r*74.9%
neg-mul-174.9%
associate-*r/75.0%
*-rgt-identity75.0%
neg-sub075.0%
associate--r-75.0%
metadata-eval75.0%
Simplified75.0%
Taylor expanded in z around inf 78.5%
Final simplification82.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.05) (not (<= z 2.8e-13))) (* (/ x z) (+ y t)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05) || !(z <= 2.8e-13)) {
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 <= (-1.05d0)) .or. (.not. (z <= 2.8d-13))) 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 <= -1.05) || !(z <= 2.8e-13)) {
tmp = (x / z) * (y + t);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.05) or not (z <= 2.8e-13): tmp = (x / z) * (y + t) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.05) || !(z <= 2.8e-13)) tmp = Float64(Float64(x / 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 <= -1.05) || ~((z <= 2.8e-13))) 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, -1.05], N[Not[LessEqual[z, 2.8e-13]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \lor \neg \left(z \leq 2.8 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -1.05000000000000004 or 2.8000000000000002e-13 < z Initial program 98.5%
Taylor expanded in z around inf 87.0%
*-commutative87.0%
associate-/l*97.4%
associate-/r/82.1%
cancel-sign-sub-inv82.1%
metadata-eval82.1%
*-lft-identity82.1%
Simplified82.1%
if -1.05000000000000004 < z < 2.8000000000000002e-13Initial program 92.1%
Taylor expanded in z around 0 91.7%
associate-*l/87.9%
associate-*r*87.9%
neg-mul-187.9%
distribute-rgt-out92.1%
unsub-neg92.1%
Simplified92.1%
Final simplification86.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 2.8e-13))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 2.8e-13)) {
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 <= (-1.0d0)) .or. (.not. (z <= 2.8d-13))) 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 <= -1.0) || !(z <= 2.8e-13)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 2.8e-13): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 2.8e-13)) 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 <= -1.0) || ~((z <= 2.8e-13))) 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, -1.0], N[Not[LessEqual[z, 2.8e-13]], $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 -1 \lor \neg \left(z \leq 2.8 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -1 or 2.8000000000000002e-13 < z Initial program 98.5%
Taylor expanded in z around inf 87.0%
associate-/l*80.0%
associate-/r/97.7%
cancel-sign-sub-inv97.7%
metadata-eval97.7%
*-lft-identity97.7%
Simplified97.7%
if -1 < z < 2.8000000000000002e-13Initial program 92.1%
Taylor expanded in z around 0 91.7%
associate-*l/87.9%
associate-*r*87.9%
neg-mul-187.9%
distribute-rgt-out92.1%
unsub-neg92.1%
Simplified92.1%
Final simplification95.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.45e-49))) (* x (/ t z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.45e-49)) {
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.45d-49))) 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.45e-49)) {
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.45e-49): 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.45e-49)) 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.45e-49))) 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.45e-49]], $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.45 \cdot 10^{-49}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -1 or 1.45e-49 < z Initial program 98.6%
Taylor expanded in y around 0 51.8%
associate-*r/51.8%
associate-*r*51.8%
neg-mul-151.8%
associate-*l/55.2%
*-commutative55.2%
neg-mul-155.2%
*-commutative55.2%
associate-*r/55.1%
metadata-eval55.1%
associate-/r*55.1%
neg-mul-155.1%
associate-*r/55.2%
*-rgt-identity55.2%
neg-sub055.2%
associate--r-55.2%
metadata-eval55.2%
Simplified55.2%
Taylor expanded in z around inf 54.9%
if -1 < z < 1.45e-49Initial program 91.7%
Taylor expanded in y around 0 31.6%
associate-*r/31.6%
associate-*r*31.6%
neg-mul-131.6%
associate-*l/31.6%
*-commutative31.6%
neg-mul-131.6%
*-commutative31.6%
associate-*r/31.6%
metadata-eval31.6%
associate-/r*31.6%
neg-mul-131.6%
associate-*r/31.6%
*-rgt-identity31.6%
neg-sub031.6%
associate--r-31.6%
metadata-eval31.6%
Simplified31.6%
Taylor expanded in z around 0 31.6%
mul-1-neg31.6%
Simplified31.6%
Final simplification44.5%
(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 95.5%
Taylor expanded in y around 0 42.7%
associate-*r/42.7%
associate-*r*42.7%
neg-mul-142.7%
associate-*l/44.6%
*-commutative44.6%
neg-mul-144.6%
*-commutative44.6%
associate-*r/44.5%
metadata-eval44.5%
associate-/r*44.5%
neg-mul-144.5%
associate-*r/44.6%
*-rgt-identity44.6%
neg-sub044.6%
associate--r-44.6%
metadata-eval44.6%
Simplified44.6%
Taylor expanded in z around 0 20.6%
mul-1-neg20.6%
Simplified20.6%
Final simplification20.6%
(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 2023230
(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)))))