
(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 (+ z -1.0)))))
(if (<= t_1 -5e+303)
(/ (* x (+ (* z t) (* y (+ z -1.0)))) (* z (+ z -1.0)))
(* t_1 x))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_1 <= -5e+303) {
tmp = (x * ((z * t) + (y * (z + -1.0)))) / (z * (z + -1.0));
} else {
tmp = t_1 * 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 = (y / z) + (t / (z + (-1.0d0)))
if (t_1 <= (-5d+303)) then
tmp = (x * ((z * t) + (y * (z + (-1.0d0))))) / (z * (z + (-1.0d0)))
else
tmp = t_1 * 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 / (z + -1.0));
double tmp;
if (t_1 <= -5e+303) {
tmp = (x * ((z * t) + (y * (z + -1.0)))) / (z * (z + -1.0));
} else {
tmp = t_1 * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) + (t / (z + -1.0)) tmp = 0 if t_1 <= -5e+303: tmp = (x * ((z * t) + (y * (z + -1.0)))) / (z * (z + -1.0)) else: tmp = t_1 * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) + Float64(t / Float64(z + -1.0))) tmp = 0.0 if (t_1 <= -5e+303) tmp = Float64(Float64(x * Float64(Float64(z * t) + Float64(y * Float64(z + -1.0)))) / Float64(z * Float64(z + -1.0))); else tmp = Float64(t_1 * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) + (t / (z + -1.0)); tmp = 0.0; if (t_1 <= -5e+303) tmp = (x * ((z * t) + (y * (z + -1.0)))) / (z * (z + -1.0)); else tmp = t_1 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+303], N[(N[(x * N[(N[(z * t), $MachinePrecision] + N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} + \frac{t}{z + -1}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+303}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot t + y \cdot \left(z + -1\right)\right)}{z \cdot \left(z + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot x\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -4.9999999999999997e303Initial program 66.7%
*-commutative66.7%
frac-sub66.7%
associate-*l/100.0%
Applied egg-rr100.0%
if -4.9999999999999997e303 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 96.9%
Final simplification97.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- x))) (t_2 (/ (* y x) z)))
(if (<= y -1.55e+40)
t_2
(if (<= y -1.75e-122)
(* x (/ t z))
(if (<= y -1.15e-150)
t_1
(if (<= y 4.8e-276) (/ (* t x) z) (if (<= y 1.1e-127) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = t * -x;
double t_2 = (y * x) / z;
double tmp;
if (y <= -1.55e+40) {
tmp = t_2;
} else if (y <= -1.75e-122) {
tmp = x * (t / z);
} else if (y <= -1.15e-150) {
tmp = t_1;
} else if (y <= 4.8e-276) {
tmp = (t * x) / z;
} else if (y <= 1.1e-127) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t * -x
t_2 = (y * x) / z
if (y <= (-1.55d+40)) then
tmp = t_2
else if (y <= (-1.75d-122)) then
tmp = x * (t / z)
else if (y <= (-1.15d-150)) then
tmp = t_1
else if (y <= 4.8d-276) then
tmp = (t * x) / z
else if (y <= 1.1d-127) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * -x;
double t_2 = (y * x) / z;
double tmp;
if (y <= -1.55e+40) {
tmp = t_2;
} else if (y <= -1.75e-122) {
tmp = x * (t / z);
} else if (y <= -1.15e-150) {
tmp = t_1;
} else if (y <= 4.8e-276) {
tmp = (t * x) / z;
} else if (y <= 1.1e-127) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * -x t_2 = (y * x) / z tmp = 0 if y <= -1.55e+40: tmp = t_2 elif y <= -1.75e-122: tmp = x * (t / z) elif y <= -1.15e-150: tmp = t_1 elif y <= 4.8e-276: tmp = (t * x) / z elif y <= 1.1e-127: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(-x)) t_2 = Float64(Float64(y * x) / z) tmp = 0.0 if (y <= -1.55e+40) tmp = t_2; elseif (y <= -1.75e-122) tmp = Float64(x * Float64(t / z)); elseif (y <= -1.15e-150) tmp = t_1; elseif (y <= 4.8e-276) tmp = Float64(Float64(t * x) / z); elseif (y <= 1.1e-127) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * -x; t_2 = (y * x) / z; tmp = 0.0; if (y <= -1.55e+40) tmp = t_2; elseif (y <= -1.75e-122) tmp = x * (t / z); elseif (y <= -1.15e-150) tmp = t_1; elseif (y <= 4.8e-276) tmp = (t * x) / z; elseif (y <= 1.1e-127) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * (-x)), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -1.55e+40], t$95$2, If[LessEqual[y, -1.75e-122], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.15e-150], t$95$1, If[LessEqual[y, 4.8e-276], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 1.1e-127], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(-x\right)\\
t_2 := \frac{y \cdot x}{z}\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{+40}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.75 \cdot 10^{-122}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{-150}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-276}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-127}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.5499999999999999e40 or 1.1000000000000001e-127 < y Initial program 91.2%
Taylor expanded in y around inf 80.1%
if -1.5499999999999999e40 < y < -1.7500000000000001e-122Initial program 99.7%
Taylor expanded in z around inf 72.8%
*-commutative72.8%
remove-double-neg72.8%
cancel-sign-sub-inv72.8%
metadata-eval72.8%
*-lft-identity72.8%
distribute-neg-out72.8%
neg-mul-172.8%
sub-neg72.8%
distribute-lft-neg-in72.8%
*-commutative72.8%
distribute-neg-frac72.8%
associate-/l*86.0%
distribute-rgt-neg-in86.0%
distribute-neg-frac86.0%
Simplified86.0%
Taylor expanded in y around inf 68.9%
times-frac75.5%
distribute-rgt1-in75.5%
Simplified75.5%
Taylor expanded in y around 0 44.2%
*-commutative44.2%
associate-/l*57.4%
Simplified57.4%
if -1.7500000000000001e-122 < y < -1.15000000000000001e-150 or 4.79999999999999965e-276 < y < 1.1000000000000001e-127Initial program 99.9%
sub-neg99.9%
distribute-rgt-in99.9%
distribute-neg-frac99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 76.7%
+-commutative76.7%
associate-*r*79.9%
*-commutative79.9%
neg-mul-179.9%
distribute-lft-neg-in79.9%
cancel-sign-sub-inv79.9%
*-commutative79.9%
associate-*r*79.5%
distribute-rgt-out--79.5%
Simplified79.5%
Taylor expanded in y around 0 73.4%
associate-*r*73.4%
neg-mul-173.4%
Simplified73.4%
if -1.15000000000000001e-150 < y < 4.79999999999999965e-276Initial program 94.3%
Taylor expanded in z around inf 69.3%
*-commutative69.3%
remove-double-neg69.3%
cancel-sign-sub-inv69.3%
metadata-eval69.3%
*-lft-identity69.3%
distribute-neg-out69.3%
neg-mul-169.3%
sub-neg69.3%
distribute-lft-neg-in69.3%
*-commutative69.3%
distribute-neg-frac69.3%
associate-/l*69.5%
distribute-rgt-neg-in69.5%
distribute-neg-frac69.5%
Simplified69.5%
Taylor expanded in t around 0 69.3%
associate-/l*60.9%
*-commutative60.9%
associate-/l*63.7%
distribute-rgt-out63.7%
+-commutative63.7%
Simplified63.7%
Taylor expanded in y around 0 63.5%
Final simplification74.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -2.85e+147)
t_1
(if (<= t 9.2e+146)
(* (/ y z) x)
(if (or (<= t 1.15e+250) (not (<= t 5.6e+298))) (* t (- x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -2.85e+147) {
tmp = t_1;
} else if (t <= 9.2e+146) {
tmp = (y / z) * x;
} else if ((t <= 1.15e+250) || !(t <= 5.6e+298)) {
tmp = t * -x;
} 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 * (t / z)
if (t <= (-2.85d+147)) then
tmp = t_1
else if (t <= 9.2d+146) then
tmp = (y / z) * x
else if ((t <= 1.15d+250) .or. (.not. (t <= 5.6d+298))) then
tmp = t * -x
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 tmp;
if (t <= -2.85e+147) {
tmp = t_1;
} else if (t <= 9.2e+146) {
tmp = (y / z) * x;
} else if ((t <= 1.15e+250) || !(t <= 5.6e+298)) {
tmp = t * -x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -2.85e+147: tmp = t_1 elif t <= 9.2e+146: tmp = (y / z) * x elif (t <= 1.15e+250) or not (t <= 5.6e+298): tmp = t * -x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -2.85e+147) tmp = t_1; elseif (t <= 9.2e+146) tmp = Float64(Float64(y / z) * x); elseif ((t <= 1.15e+250) || !(t <= 5.6e+298)) tmp = Float64(t * Float64(-x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -2.85e+147) tmp = t_1; elseif (t <= 9.2e+146) tmp = (y / z) * x; elseif ((t <= 1.15e+250) || ~((t <= 5.6e+298))) tmp = t * -x; 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]}, If[LessEqual[t, -2.85e+147], t$95$1, If[LessEqual[t, 9.2e+146], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[Or[LessEqual[t, 1.15e+250], N[Not[LessEqual[t, 5.6e+298]], $MachinePrecision]], N[(t * (-x)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -2.85 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{+146}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+250} \lor \neg \left(t \leq 5.6 \cdot 10^{+298}\right):\\
\;\;\;\;t \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.84999999999999996e147 or 1.1500000000000001e250 < t < 5.60000000000000033e298Initial program 95.8%
Taylor expanded in z around inf 51.5%
*-commutative51.5%
remove-double-neg51.5%
cancel-sign-sub-inv51.5%
metadata-eval51.5%
*-lft-identity51.5%
distribute-neg-out51.5%
neg-mul-151.5%
sub-neg51.5%
distribute-lft-neg-in51.5%
*-commutative51.5%
distribute-neg-frac51.5%
associate-/l*69.3%
distribute-rgt-neg-in69.3%
distribute-neg-frac69.3%
Simplified69.3%
Taylor expanded in y around inf 47.0%
times-frac50.9%
distribute-rgt1-in50.9%
Simplified50.9%
Taylor expanded in y around 0 45.5%
*-commutative45.5%
associate-/l*65.3%
Simplified65.3%
if -2.84999999999999996e147 < t < 9.20000000000000001e146Initial program 92.7%
Taylor expanded in y around inf 77.4%
associate-*r/75.5%
Simplified75.5%
if 9.20000000000000001e146 < t < 1.1500000000000001e250 or 5.60000000000000033e298 < t Initial program 96.4%
sub-neg96.4%
distribute-rgt-in92.6%
distribute-neg-frac92.6%
Applied egg-rr92.6%
Taylor expanded in z around 0 62.8%
+-commutative62.8%
associate-*r*65.0%
*-commutative65.0%
neg-mul-165.0%
distribute-lft-neg-in65.0%
cancel-sign-sub-inv65.0%
*-commutative65.0%
associate-*r*64.7%
distribute-rgt-out--68.6%
Simplified68.6%
Taylor expanded in y around 0 51.4%
associate-*r*51.4%
neg-mul-151.4%
Simplified51.4%
Final simplification71.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -3.1e+146)
t_1
(if (<= t 4.4e+143)
(* (/ y z) x)
(if (<= t 2.2e+249)
(* t (- x))
(if (<= t 6.5e+298) t_1 (* y (/ x z))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -3.1e+146) {
tmp = t_1;
} else if (t <= 4.4e+143) {
tmp = (y / z) * x;
} else if (t <= 2.2e+249) {
tmp = t * -x;
} else if (t <= 6.5e+298) {
tmp = t_1;
} 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 = x * (t / z)
if (t <= (-3.1d+146)) then
tmp = t_1
else if (t <= 4.4d+143) then
tmp = (y / z) * x
else if (t <= 2.2d+249) then
tmp = t * -x
else if (t <= 6.5d+298) then
tmp = t_1
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 = x * (t / z);
double tmp;
if (t <= -3.1e+146) {
tmp = t_1;
} else if (t <= 4.4e+143) {
tmp = (y / z) * x;
} else if (t <= 2.2e+249) {
tmp = t * -x;
} else if (t <= 6.5e+298) {
tmp = t_1;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -3.1e+146: tmp = t_1 elif t <= 4.4e+143: tmp = (y / z) * x elif t <= 2.2e+249: tmp = t * -x elif t <= 6.5e+298: tmp = t_1 else: tmp = y * (x / z) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -3.1e+146) tmp = t_1; elseif (t <= 4.4e+143) tmp = Float64(Float64(y / z) * x); elseif (t <= 2.2e+249) tmp = Float64(t * Float64(-x)); elseif (t <= 6.5e+298) tmp = t_1; else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -3.1e+146) tmp = t_1; elseif (t <= 4.4e+143) tmp = (y / z) * x; elseif (t <= 2.2e+249) tmp = t * -x; elseif (t <= 6.5e+298) tmp = t_1; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.1e+146], t$95$1, If[LessEqual[t, 4.4e+143], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 2.2e+249], N[(t * (-x)), $MachinePrecision], If[LessEqual[t, 6.5e+298], t$95$1, N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+143}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+249}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+298}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if t < -3.1000000000000002e146 or 2.1999999999999998e249 < t < 6.5e298Initial program 95.8%
Taylor expanded in z around inf 51.5%
*-commutative51.5%
remove-double-neg51.5%
cancel-sign-sub-inv51.5%
metadata-eval51.5%
*-lft-identity51.5%
distribute-neg-out51.5%
neg-mul-151.5%
sub-neg51.5%
distribute-lft-neg-in51.5%
*-commutative51.5%
distribute-neg-frac51.5%
associate-/l*69.3%
distribute-rgt-neg-in69.3%
distribute-neg-frac69.3%
Simplified69.3%
Taylor expanded in y around inf 47.0%
times-frac50.9%
distribute-rgt1-in50.9%
Simplified50.9%
Taylor expanded in y around 0 45.5%
*-commutative45.5%
associate-/l*65.3%
Simplified65.3%
if -3.1000000000000002e146 < t < 4.40000000000000028e143Initial program 92.7%
Taylor expanded in y around inf 77.4%
associate-*r/75.5%
Simplified75.5%
if 4.40000000000000028e143 < t < 2.1999999999999998e249Initial program 100.0%
sub-neg100.0%
distribute-rgt-in95.7%
distribute-neg-frac95.7%
Applied egg-rr95.7%
Taylor expanded in z around 0 60.4%
+-commutative60.4%
associate-*r*60.5%
*-commutative60.5%
neg-mul-160.5%
distribute-lft-neg-in60.5%
cancel-sign-sub-inv60.5%
*-commutative60.5%
associate-*r*60.2%
distribute-rgt-out--64.5%
Simplified64.5%
Taylor expanded in y around 0 53.0%
associate-*r*53.0%
neg-mul-153.0%
Simplified53.0%
if 6.5e298 < t Initial program 68.7%
*-commutative68.7%
frac-sub68.7%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r/99.5%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in y around inf 48.1%
associate-*l/48.1%
*-commutative48.1%
Simplified48.1%
Final simplification71.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ y z) (/ t (+ z -1.0))))) (if (<= t_1 (- INFINITY)) (/ y (/ z x)) (* t_1 x))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y / (z / x);
} else {
tmp = t_1 * x;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y / (z / x);
} else {
tmp = t_1 * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) + (t / (z + -1.0)) tmp = 0 if t_1 <= -math.inf: tmp = y / (z / x) else: tmp = t_1 * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) + Float64(t / Float64(z + -1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y / Float64(z / x)); else tmp = Float64(t_1 * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) + (t / (z + -1.0)); tmp = 0.0; if (t_1 <= -Inf) tmp = y / (z / x); else tmp = t_1 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} + \frac{t}{z + -1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot x\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0Initial program 64.2%
*-commutative64.2%
frac-sub64.2%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r/99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in y around inf 99.9%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
clear-num99.8%
un-div-inv100.0%
Applied egg-rr100.0%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 97.0%
Final simplification97.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= z -3.3e+226)
t_1
(if (<= z -6.5e+26)
(* (/ y z) x)
(if (<= z 4.8e+155) (* x (- (/ y z) t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (z <= -3.3e+226) {
tmp = t_1;
} else if (z <= -6.5e+26) {
tmp = (y / z) * x;
} else if (z <= 4.8e+155) {
tmp = x * ((y / z) - 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 * (t / z)
if (z <= (-3.3d+226)) then
tmp = t_1
else if (z <= (-6.5d+26)) then
tmp = (y / z) * x
else if (z <= 4.8d+155) then
tmp = x * ((y / z) - 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 * (t / z);
double tmp;
if (z <= -3.3e+226) {
tmp = t_1;
} else if (z <= -6.5e+26) {
tmp = (y / z) * x;
} else if (z <= 4.8e+155) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if z <= -3.3e+226: tmp = t_1 elif z <= -6.5e+26: tmp = (y / z) * x elif z <= 4.8e+155: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (z <= -3.3e+226) tmp = t_1; elseif (z <= -6.5e+26) tmp = Float64(Float64(y / z) * x); elseif (z <= 4.8e+155) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (z <= -3.3e+226) tmp = t_1; elseif (z <= -6.5e+26) tmp = (y / z) * x; elseif (z <= 4.8e+155) tmp = x * ((y / z) - t); 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]}, If[LessEqual[z, -3.3e+226], t$95$1, If[LessEqual[z, -6.5e+26], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 4.8e+155], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{+26}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+155}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.29999999999999978e226 or 4.80000000000000042e155 < z Initial program 94.2%
Taylor expanded in z around inf 76.7%
*-commutative76.7%
remove-double-neg76.7%
cancel-sign-sub-inv76.7%
metadata-eval76.7%
*-lft-identity76.7%
distribute-neg-out76.7%
neg-mul-176.7%
sub-neg76.7%
distribute-lft-neg-in76.7%
*-commutative76.7%
distribute-neg-frac76.7%
associate-/l*94.1%
distribute-rgt-neg-in94.1%
distribute-neg-frac94.1%
Simplified94.1%
Taylor expanded in y around inf 68.1%
times-frac70.3%
distribute-rgt1-in70.3%
Simplified70.3%
Taylor expanded in y around 0 54.9%
*-commutative54.9%
associate-/l*68.5%
Simplified68.5%
if -3.29999999999999978e226 < z < -6.50000000000000022e26Initial program 99.8%
Taylor expanded in y around inf 67.7%
associate-*r/72.6%
Simplified72.6%
if -6.50000000000000022e26 < z < 4.80000000000000042e155Initial program 92.0%
Taylor expanded in z around 0 87.1%
mul-1-neg87.1%
unsub-neg87.1%
div-sub87.1%
associate-/l*87.2%
*-inverses87.2%
*-rgt-identity87.2%
Simplified87.2%
Final simplification81.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* x (/ (+ y t) z)) (/ (* x (- y (* z t))) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = (x * (y - (z * t))) / z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((y + t) / z)
else
tmp = (x * (y - (z * t))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = (x * (y - (z * t))) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = x * ((y + t) / z) else: tmp = (x * (y - (z * t))) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(y + t) / z)); else tmp = Float64(Float64(x * Float64(y - Float64(z * t))) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = x * ((y + t) / z); else tmp = (x * (y - (z * t))) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - z \cdot t\right)}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 97.5%
Taylor expanded in z around inf 86.7%
*-commutative86.7%
remove-double-neg86.7%
cancel-sign-sub-inv86.7%
metadata-eval86.7%
*-lft-identity86.7%
distribute-neg-out86.7%
neg-mul-186.7%
sub-neg86.7%
distribute-lft-neg-in86.7%
*-commutative86.7%
distribute-neg-frac86.7%
associate-/l*97.0%
distribute-rgt-neg-in97.0%
distribute-neg-frac97.0%
Simplified97.0%
if -1 < z < 1Initial program 90.2%
sub-neg90.2%
distribute-rgt-in87.3%
distribute-neg-frac87.3%
Applied egg-rr87.3%
Taylor expanded in z around 0 93.0%
+-commutative93.0%
associate-*r*93.3%
*-commutative93.3%
neg-mul-193.3%
distribute-lft-neg-in93.3%
cancel-sign-sub-inv93.3%
*-commutative93.3%
associate-*r*94.7%
distribute-rgt-out--96.2%
Simplified96.2%
Final simplification96.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((y + t) / z)
else
tmp = x * ((y / z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(y + t) / z)); else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = x * ((y + t) / z); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 97.5%
Taylor expanded in z around inf 86.7%
*-commutative86.7%
remove-double-neg86.7%
cancel-sign-sub-inv86.7%
metadata-eval86.7%
*-lft-identity86.7%
distribute-neg-out86.7%
neg-mul-186.7%
sub-neg86.7%
distribute-lft-neg-in86.7%
*-commutative86.7%
distribute-neg-frac86.7%
associate-/l*97.0%
distribute-rgt-neg-in97.0%
distribute-neg-frac97.0%
Simplified97.0%
if -1 < z < 1Initial program 90.2%
Taylor expanded in z around 0 89.9%
mul-1-neg89.9%
unsub-neg89.9%
div-sub89.9%
associate-/l*90.0%
*-inverses90.0%
*-rgt-identity90.0%
Simplified90.0%
Final simplification93.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.2e-10) (not (<= z 9.5e-37))) (* x (/ t z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.2e-10) || !(z <= 9.5e-37)) {
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 <= (-6.2d-10)) .or. (.not. (z <= 9.5d-37))) 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 <= -6.2e-10) || !(z <= 9.5e-37)) {
tmp = x * (t / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6.2e-10) or not (z <= 9.5e-37): tmp = x * (t / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.2e-10) || !(z <= 9.5e-37)) 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 <= -6.2e-10) || ~((z <= 9.5e-37))) tmp = x * (t / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.2e-10], N[Not[LessEqual[z, 9.5e-37]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-10} \lor \neg \left(z \leq 9.5 \cdot 10^{-37}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -6.2000000000000003e-10 or 9.49999999999999927e-37 < z Initial program 97.0%
Taylor expanded in z around inf 87.1%
*-commutative87.1%
remove-double-neg87.1%
cancel-sign-sub-inv87.1%
metadata-eval87.1%
*-lft-identity87.1%
distribute-neg-out87.1%
neg-mul-187.1%
sub-neg87.1%
distribute-lft-neg-in87.1%
*-commutative87.1%
distribute-neg-frac87.1%
associate-/l*95.8%
distribute-rgt-neg-in95.8%
distribute-neg-frac95.8%
Simplified95.8%
Taylor expanded in y around inf 78.9%
times-frac77.5%
distribute-rgt1-in77.5%
Simplified77.5%
Taylor expanded in y around 0 46.5%
*-commutative46.5%
associate-/l*52.2%
Simplified52.2%
if -6.2000000000000003e-10 < z < 9.49999999999999927e-37Initial program 90.0%
sub-neg90.0%
distribute-rgt-in87.6%
distribute-neg-frac87.6%
Applied egg-rr87.6%
Taylor expanded in z around 0 93.4%
+-commutative93.4%
associate-*r*93.8%
*-commutative93.8%
neg-mul-193.8%
distribute-lft-neg-in93.8%
cancel-sign-sub-inv93.8%
*-commutative93.8%
associate-*r*95.2%
distribute-rgt-out--96.1%
Simplified96.1%
Taylor expanded in y around 0 30.1%
associate-*r*30.1%
neg-mul-130.1%
Simplified30.1%
Final simplification41.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.2e-10) (not (<= z 9.5e-37))) (* t (/ x z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.2e-10) || !(z <= 9.5e-37)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-6.2d-10)) .or. (.not. (z <= 9.5d-37))) then
tmp = t * (x / z)
else
tmp = t * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.2e-10) || !(z <= 9.5e-37)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6.2e-10) or not (z <= 9.5e-37): tmp = t * (x / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.2e-10) || !(z <= 9.5e-37)) tmp = Float64(t * Float64(x / z)); else tmp = Float64(t * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6.2e-10) || ~((z <= 9.5e-37))) tmp = t * (x / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.2e-10], N[Not[LessEqual[z, 9.5e-37]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-10} \lor \neg \left(z \leq 9.5 \cdot 10^{-37}\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -6.2000000000000003e-10 or 9.49999999999999927e-37 < z Initial program 97.0%
Taylor expanded in z around inf 87.1%
*-commutative87.1%
remove-double-neg87.1%
cancel-sign-sub-inv87.1%
metadata-eval87.1%
*-lft-identity87.1%
distribute-neg-out87.1%
neg-mul-187.1%
sub-neg87.1%
distribute-lft-neg-in87.1%
*-commutative87.1%
distribute-neg-frac87.1%
associate-/l*95.8%
distribute-rgt-neg-in95.8%
distribute-neg-frac95.8%
Simplified95.8%
Taylor expanded in t around 0 85.6%
associate-/l*84.8%
*-commutative84.8%
associate-/l*82.0%
distribute-rgt-out83.5%
+-commutative83.5%
Simplified83.5%
Taylor expanded in y around 0 46.5%
associate-/l*47.2%
Simplified47.2%
if -6.2000000000000003e-10 < z < 9.49999999999999927e-37Initial program 90.0%
sub-neg90.0%
distribute-rgt-in87.6%
distribute-neg-frac87.6%
Applied egg-rr87.6%
Taylor expanded in z around 0 93.4%
+-commutative93.4%
associate-*r*93.8%
*-commutative93.8%
neg-mul-193.8%
distribute-lft-neg-in93.8%
cancel-sign-sub-inv93.8%
*-commutative93.8%
associate-*r*95.2%
distribute-rgt-out--96.1%
Simplified96.1%
Taylor expanded in y around 0 30.1%
associate-*r*30.1%
neg-mul-130.1%
Simplified30.1%
Final simplification38.9%
(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 93.6%
sub-neg93.6%
distribute-rgt-in91.3%
distribute-neg-frac91.3%
Applied egg-rr91.3%
Taylor expanded in z around 0 67.1%
+-commutative67.1%
associate-*r*68.3%
*-commutative68.3%
neg-mul-168.3%
distribute-lft-neg-in68.3%
cancel-sign-sub-inv68.3%
*-commutative68.3%
associate-*r*69.0%
distribute-rgt-out--70.6%
Simplified70.6%
Taylor expanded in y around 0 23.6%
associate-*r*23.6%
neg-mul-123.6%
Simplified23.6%
Final simplification23.6%
(FPCore (x y z t) :precision binary64 (* t x))
double code(double x, double y, double z, double t) {
return t * x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t * x
end function
public static double code(double x, double y, double z, double t) {
return t * x;
}
def code(x, y, z, t): return t * x
function code(x, y, z, t) return Float64(t * 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 x
\end{array}
Initial program 93.6%
Taylor expanded in z around 0 67.1%
+-commutative67.1%
mul-1-neg67.1%
unsub-neg67.1%
Simplified67.1%
clear-num67.1%
inv-pow67.1%
cancel-sign-sub-inv67.1%
*-commutative67.1%
fma-define67.8%
add-sqr-sqrt37.6%
sqrt-unprod54.1%
sqr-neg54.1%
sqrt-unprod23.8%
add-sqr-sqrt54.6%
*-commutative54.6%
Applied egg-rr54.6%
unpow-154.6%
fma-define54.6%
associate-*r*55.4%
*-commutative55.4%
distribute-rgt-out56.2%
Simplified56.2%
Taylor expanded in z around inf 9.8%
(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 2024086
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:alt
(if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))