
(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 (/ t (+ z -1.0))) (t_2 (* x (- (/ y z) (/ t (- 1.0 z)))))) (if (<= t_2 (- INFINITY)) (* t_1 (/ (* x (+ z (/ y t_1))) z)) t_2)))
double code(double x, double y, double z, double t) {
double t_1 = t / (z + -1.0);
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1 * ((x * (z + (y / t_1))) / z);
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = t / (z + -1.0);
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1 * ((x * (z + (y / t_1))) / z);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t / (z + -1.0) t_2 = x * ((y / z) - (t / (1.0 - z))) tmp = 0 if t_2 <= -math.inf: tmp = t_1 * ((x * (z + (y / t_1))) / z) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t / Float64(z + -1.0)) t_2 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_1 * Float64(Float64(x * Float64(z + Float64(y / t_1))) / z)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t / (z + -1.0); t_2 = x * ((y / z) - (t / (1.0 - z))); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1 * ((x * (z + (y / t_1))) / z); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$1 * N[(N[(x * N[(z + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{z + -1}\\
t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_1 \cdot \frac{x \cdot \left(z + \frac{y}{t_1}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < -inf.0Initial program 81.0%
frac-2neg81.0%
clear-num81.0%
frac-sub77.7%
fma-neg77.7%
Applied egg-rr77.7%
associate-*r/74.4%
associate-/r/77.7%
Simplified77.7%
Taylor expanded in x around 0 96.6%
*-commutative96.6%
times-frac99.8%
sub-neg99.8%
metadata-eval99.8%
associate-/l*99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) Initial program 97.0%
Final simplification97.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (/ y z) (/ t (- 1.0 z))))) (if (<= t_1 2e+289) (* x t_1) (/ 1.0 (/ (/ z x) (+ y t))))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= 2e+289) {
tmp = x * t_1;
} else {
tmp = 1.0 / ((z / x) / (y + 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) :: t_1
real(8) :: tmp
t_1 = (y / z) - (t / (1.0d0 - z))
if (t_1 <= 2d+289) then
tmp = x * t_1
else
tmp = 1.0d0 / ((z / x) / (y + t))
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 <= 2e+289) {
tmp = x * t_1;
} else {
tmp = 1.0 / ((z / x) / (y + t));
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= 2e+289: tmp = x * t_1 else: tmp = 1.0 / ((z / x) / (y + t)) 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 <= 2e+289) tmp = Float64(x * t_1); else tmp = Float64(1.0 / Float64(Float64(z / x) / Float64(y + t))); 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 <= 2e+289) tmp = x * t_1; else tmp = 1.0 / ((z / x) / (y + t)); 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, 2e+289], N[(x * t$95$1), $MachinePrecision], N[(1.0 / N[(N[(z / x), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+289}:\\
\;\;\;\;x \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\frac{z}{x}}{y + t}}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 2.0000000000000001e289Initial program 96.7%
if 2.0000000000000001e289 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) Initial program 76.2%
Taylor expanded in z around inf 76.2%
cancel-sign-sub-inv76.2%
metadata-eval76.2%
*-lft-identity76.2%
+-commutative76.2%
Simplified76.2%
Taylor expanded in x around 0 99.8%
clear-num99.8%
inv-pow99.8%
+-commutative99.8%
Applied egg-rr99.8%
unpow-199.8%
associate-/r*100.0%
Simplified100.0%
Final simplification97.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- t))))
(if (<= t -5.8e+181)
t_1
(if (<= t 1.95e+111)
(* x (/ y z))
(if (or (<= t 5.4e+175) (not (<= t 4.5e+203))) t_1 (* y (/ x z)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * -t;
double tmp;
if (t <= -5.8e+181) {
tmp = t_1;
} else if (t <= 1.95e+111) {
tmp = x * (y / z);
} else if ((t <= 5.4e+175) || !(t <= 4.5e+203)) {
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
if (t <= (-5.8d+181)) then
tmp = t_1
else if (t <= 1.95d+111) then
tmp = x * (y / z)
else if ((t <= 5.4d+175) .or. (.not. (t <= 4.5d+203))) 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;
double tmp;
if (t <= -5.8e+181) {
tmp = t_1;
} else if (t <= 1.95e+111) {
tmp = x * (y / z);
} else if ((t <= 5.4e+175) || !(t <= 4.5e+203)) {
tmp = t_1;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * -t tmp = 0 if t <= -5.8e+181: tmp = t_1 elif t <= 1.95e+111: tmp = x * (y / z) elif (t <= 5.4e+175) or not (t <= 4.5e+203): tmp = t_1 else: tmp = y * (x / z) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(-t)) tmp = 0.0 if (t <= -5.8e+181) tmp = t_1; elseif (t <= 1.95e+111) tmp = Float64(x * Float64(y / z)); elseif ((t <= 5.4e+175) || !(t <= 4.5e+203)) 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; tmp = 0.0; if (t <= -5.8e+181) tmp = t_1; elseif (t <= 1.95e+111) tmp = x * (y / z); elseif ((t <= 5.4e+175) || ~((t <= 4.5e+203))) tmp = t_1; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-t)), $MachinePrecision]}, If[LessEqual[t, -5.8e+181], t$95$1, If[LessEqual[t, 1.95e+111], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 5.4e+175], N[Not[LessEqual[t, 4.5e+203]], $MachinePrecision]], t$95$1, N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(-t\right)\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+181}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+111}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{+175} \lor \neg \left(t \leq 4.5 \cdot 10^{+203}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if t < -5.8e181 or 1.9499999999999999e111 < t < 5.4000000000000002e175 or 4.5000000000000003e203 < t Initial program 98.1%
Taylor expanded in z around 0 55.9%
+-commutative55.9%
associate-*r/54.3%
*-commutative54.3%
associate-*r*54.3%
neg-mul-154.3%
distribute-rgt-out56.1%
unsub-neg56.1%
Simplified56.1%
Taylor expanded in y around 0 50.4%
associate-*r*50.4%
neg-mul-150.4%
Simplified50.4%
if -5.8e181 < t < 1.9499999999999999e111Initial program 95.5%
Taylor expanded in y around inf 69.2%
associate-*r/72.2%
Simplified72.2%
if 5.4000000000000002e175 < t < 4.5000000000000003e203Initial program 74.0%
Taylor expanded in z around inf 65.0%
cancel-sign-sub-inv65.0%
metadata-eval65.0%
*-lft-identity65.0%
+-commutative65.0%
Simplified65.0%
associate-*r/73.9%
+-commutative73.9%
*-un-lft-identity73.9%
metadata-eval73.9%
cancel-sign-sub-inv73.9%
associate-/l*67.2%
cancel-sign-sub-inv67.2%
metadata-eval67.2%
*-un-lft-identity67.2%
+-commutative67.2%
Applied egg-rr67.2%
Taylor expanded in t around 0 57.8%
associate-*l/56.1%
*-commutative56.1%
Simplified56.1%
Final simplification66.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -2.65e+39)
t_1
(if (<= t 1e+111) (* x (/ y z)) (if (<= t 1.32e+171) (* x (- t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -2.65e+39) {
tmp = t_1;
} else if (t <= 1e+111) {
tmp = x * (y / z);
} else if (t <= 1.32e+171) {
tmp = x * -t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (t <= (-2.65d+39)) then
tmp = t_1
else if (t <= 1d+111) then
tmp = x * (y / z)
else if (t <= 1.32d+171) then
tmp = x * -t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -2.65e+39) {
tmp = t_1;
} else if (t <= 1e+111) {
tmp = x * (y / z);
} else if (t <= 1.32e+171) {
tmp = x * -t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -2.65e+39: tmp = t_1 elif t <= 1e+111: tmp = x * (y / z) elif t <= 1.32e+171: tmp = x * -t 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.65e+39) tmp = t_1; elseif (t <= 1e+111) tmp = Float64(x * Float64(y / z)); elseif (t <= 1.32e+171) tmp = Float64(x * Float64(-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 (t <= -2.65e+39) tmp = t_1; elseif (t <= 1e+111) tmp = x * (y / z); elseif (t <= 1.32e+171) tmp = x * -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[t, -2.65e+39], t$95$1, If[LessEqual[t, 1e+111], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.32e+171], N[(x * (-t)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -2.65 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 10^{+111}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 1.32 \cdot 10^{+171}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.64999999999999989e39 or 1.32000000000000009e171 < t Initial program 96.0%
Taylor expanded in z around inf 68.9%
cancel-sign-sub-inv68.9%
metadata-eval68.9%
*-lft-identity68.9%
+-commutative68.9%
Simplified68.9%
Taylor expanded in t around inf 50.1%
associate-/l*46.5%
Simplified46.5%
associate-/r/58.9%
Applied egg-rr58.9%
if -2.64999999999999989e39 < t < 9.99999999999999957e110Initial program 94.8%
Taylor expanded in y around inf 75.7%
associate-*r/78.7%
Simplified78.7%
if 9.99999999999999957e110 < t < 1.32000000000000009e171Initial program 94.6%
Taylor expanded in z around 0 73.3%
+-commutative73.3%
associate-*r/68.1%
*-commutative68.1%
associate-*r*68.1%
neg-mul-168.1%
distribute-rgt-out68.1%
unsub-neg68.1%
Simplified68.1%
Taylor expanded in y around 0 62.5%
associate-*r*62.5%
neg-mul-162.5%
Simplified62.5%
Final simplification71.8%
(FPCore (x y z t)
:precision binary64
(if (<= t -4.4e+36)
(/ x (/ z t))
(if (<= t 7.2e+110)
(* x (/ y z))
(if (<= t 2.3e+171) (* x (- t)) (* x (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.4e+36) {
tmp = x / (z / t);
} else if (t <= 7.2e+110) {
tmp = x * (y / z);
} else if (t <= 2.3e+171) {
tmp = x * -t;
} 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 (t <= (-4.4d+36)) then
tmp = x / (z / t)
else if (t <= 7.2d+110) then
tmp = x * (y / z)
else if (t <= 2.3d+171) then
tmp = x * -t
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 (t <= -4.4e+36) {
tmp = x / (z / t);
} else if (t <= 7.2e+110) {
tmp = x * (y / z);
} else if (t <= 2.3e+171) {
tmp = x * -t;
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.4e+36: tmp = x / (z / t) elif t <= 7.2e+110: tmp = x * (y / z) elif t <= 2.3e+171: tmp = x * -t else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.4e+36) tmp = Float64(x / Float64(z / t)); elseif (t <= 7.2e+110) tmp = Float64(x * Float64(y / z)); elseif (t <= 2.3e+171) tmp = Float64(x * Float64(-t)); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -4.4e+36) tmp = x / (z / t); elseif (t <= 7.2e+110) tmp = x * (y / z); elseif (t <= 2.3e+171) tmp = x * -t; else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.4e+36], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e+110], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e+171], N[(x * (-t)), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{+36}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+110}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+171}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if t < -4.40000000000000001e36Initial program 99.8%
Taylor expanded in z around inf 67.6%
cancel-sign-sub-inv67.6%
metadata-eval67.6%
*-lft-identity67.6%
+-commutative67.6%
Simplified67.6%
associate-*r/59.2%
+-commutative59.2%
*-un-lft-identity59.2%
metadata-eval59.2%
cancel-sign-sub-inv59.2%
associate-/l*67.6%
cancel-sign-sub-inv67.6%
metadata-eval67.6%
*-un-lft-identity67.6%
+-commutative67.6%
Applied egg-rr67.6%
Taylor expanded in t around inf 55.6%
if -4.40000000000000001e36 < t < 7.1999999999999994e110Initial program 94.8%
Taylor expanded in y around inf 75.7%
associate-*r/78.7%
Simplified78.7%
if 7.1999999999999994e110 < t < 2.30000000000000017e171Initial program 94.6%
Taylor expanded in z around 0 73.3%
+-commutative73.3%
associate-*r/68.1%
*-commutative68.1%
associate-*r*68.1%
neg-mul-168.1%
distribute-rgt-out68.1%
unsub-neg68.1%
Simplified68.1%
Taylor expanded in y around 0 62.5%
associate-*r*62.5%
neg-mul-162.5%
Simplified62.5%
if 2.30000000000000017e171 < t Initial program 90.3%
Taylor expanded in z around inf 70.9%
cancel-sign-sub-inv70.9%
metadata-eval70.9%
*-lft-identity70.9%
+-commutative70.9%
Simplified70.9%
Taylor expanded in t around inf 51.7%
associate-/l*48.7%
Simplified48.7%
associate-/r/64.0%
Applied egg-rr64.0%
Final simplification71.8%
(FPCore (x y z t)
:precision binary64
(if (<= t -4.2e+39)
(/ x (/ z t))
(if (<= t 7e+104)
(/ x (/ z y))
(if (<= t 1.2e+171) (* x (- t)) (* x (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.2e+39) {
tmp = x / (z / t);
} else if (t <= 7e+104) {
tmp = x / (z / y);
} else if (t <= 1.2e+171) {
tmp = x * -t;
} 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 (t <= (-4.2d+39)) then
tmp = x / (z / t)
else if (t <= 7d+104) then
tmp = x / (z / y)
else if (t <= 1.2d+171) then
tmp = x * -t
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 (t <= -4.2e+39) {
tmp = x / (z / t);
} else if (t <= 7e+104) {
tmp = x / (z / y);
} else if (t <= 1.2e+171) {
tmp = x * -t;
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.2e+39: tmp = x / (z / t) elif t <= 7e+104: tmp = x / (z / y) elif t <= 1.2e+171: tmp = x * -t else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.2e+39) tmp = Float64(x / Float64(z / t)); elseif (t <= 7e+104) tmp = Float64(x / Float64(z / y)); elseif (t <= 1.2e+171) tmp = Float64(x * Float64(-t)); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -4.2e+39) tmp = x / (z / t); elseif (t <= 7e+104) tmp = x / (z / y); elseif (t <= 1.2e+171) tmp = x * -t; else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.2e+39], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e+104], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e+171], N[(x * (-t)), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+39}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+104}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+171}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if t < -4.1999999999999997e39Initial program 99.8%
Taylor expanded in z around inf 67.6%
cancel-sign-sub-inv67.6%
metadata-eval67.6%
*-lft-identity67.6%
+-commutative67.6%
Simplified67.6%
associate-*r/59.2%
+-commutative59.2%
*-un-lft-identity59.2%
metadata-eval59.2%
cancel-sign-sub-inv59.2%
associate-/l*67.6%
cancel-sign-sub-inv67.6%
metadata-eval67.6%
*-un-lft-identity67.6%
+-commutative67.6%
Applied egg-rr67.6%
Taylor expanded in t around inf 55.6%
if -4.1999999999999997e39 < t < 7.0000000000000003e104Initial program 94.7%
frac-2neg94.7%
div-inv94.6%
fma-neg94.6%
distribute-neg-frac94.6%
Applied egg-rr94.6%
fma-udef94.6%
+-commutative94.6%
distribute-lft-neg-out94.6%
unsub-neg94.6%
neg-mul-194.6%
*-commutative94.6%
associate-*r/94.6%
metadata-eval94.6%
associate-/r*94.6%
neg-mul-194.6%
associate-*r/94.6%
*-rgt-identity94.6%
neg-sub094.6%
associate--r-94.6%
metadata-eval94.6%
neg-mul-194.6%
associate-/r*94.6%
metadata-eval94.6%
Simplified94.6%
Taylor expanded in t around 0 76.0%
associate-/l*79.4%
Simplified79.4%
if 7.0000000000000003e104 < t < 1.19999999999999999e171Initial program 95.2%
Taylor expanded in z around 0 75.9%
+-commutative75.9%
associate-*r/71.3%
*-commutative71.3%
associate-*r*71.3%
neg-mul-171.3%
distribute-rgt-out71.3%
unsub-neg71.3%
Simplified71.3%
Taylor expanded in y around 0 61.3%
associate-*r*61.3%
neg-mul-161.3%
Simplified61.3%
if 1.19999999999999999e171 < t Initial program 90.3%
Taylor expanded in z around inf 70.9%
cancel-sign-sub-inv70.9%
metadata-eval70.9%
*-lft-identity70.9%
+-commutative70.9%
Simplified70.9%
Taylor expanded in t around inf 51.7%
associate-/l*48.7%
Simplified48.7%
associate-/r/64.0%
Applied egg-rr64.0%
Final simplification72.0%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.7e+72)
(/ x (/ z t))
(if (<= z 48.0)
(* x (- (/ y z) t))
(if (<= z 2.3e+84) (* x (/ t z)) (* x (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e+72) {
tmp = x / (z / t);
} else if (z <= 48.0) {
tmp = x * ((y / z) - t);
} else if (z <= 2.3e+84) {
tmp = x * (t / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.7d+72)) then
tmp = x / (z / t)
else if (z <= 48.0d0) then
tmp = x * ((y / z) - t)
else if (z <= 2.3d+84) then
tmp = x * (t / z)
else
tmp = x * (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e+72) {
tmp = x / (z / t);
} else if (z <= 48.0) {
tmp = x * ((y / z) - t);
} else if (z <= 2.3e+84) {
tmp = x * (t / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.7e+72: tmp = x / (z / t) elif z <= 48.0: tmp = x * ((y / z) - t) elif z <= 2.3e+84: tmp = x * (t / z) else: tmp = x * (y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.7e+72) tmp = Float64(x / Float64(z / t)); elseif (z <= 48.0) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (z <= 2.3e+84) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.7e+72) tmp = x / (z / t); elseif (z <= 48.0) tmp = x * ((y / z) - t); elseif (z <= 2.3e+84) tmp = x * (t / z); else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.7e+72], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 48.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+84], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+72}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;z \leq 48:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+84}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -1.6999999999999999e72Initial program 97.6%
Taylor expanded in z around inf 97.6%
cancel-sign-sub-inv97.6%
metadata-eval97.6%
*-lft-identity97.6%
+-commutative97.6%
Simplified97.6%
associate-*r/77.7%
+-commutative77.7%
*-un-lft-identity77.7%
metadata-eval77.7%
cancel-sign-sub-inv77.7%
associate-/l*97.6%
cancel-sign-sub-inv97.6%
metadata-eval97.6%
*-un-lft-identity97.6%
+-commutative97.6%
Applied egg-rr97.6%
Taylor expanded in t around inf 64.8%
if -1.6999999999999999e72 < z < 48Initial program 94.4%
Taylor expanded in z around 0 89.6%
+-commutative89.6%
associate-*r/89.3%
*-commutative89.3%
associate-*r*89.3%
neg-mul-189.3%
distribute-rgt-out90.6%
unsub-neg90.6%
Simplified90.6%
if 48 < z < 2.2999999999999999e84Initial program 99.6%
Taylor expanded in z around inf 99.6%
cancel-sign-sub-inv99.6%
metadata-eval99.6%
*-lft-identity99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 73.3%
associate-/l*66.0%
Simplified66.0%
associate-/r/73.5%
Applied egg-rr73.5%
if 2.2999999999999999e84 < z Initial program 93.6%
Taylor expanded in y around inf 54.6%
associate-*r/59.2%
Simplified59.2%
Final simplification80.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.1e+39) (not (<= t 1.16e+71))) (* x (/ t (+ z -1.0))) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.1e+39) || !(t <= 1.16e+71)) {
tmp = x * (t / (z + -1.0));
} 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 ((t <= (-3.1d+39)) .or. (.not. (t <= 1.16d+71))) then
tmp = x * (t / (z + (-1.0d0)))
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 ((t <= -3.1e+39) || !(t <= 1.16e+71)) {
tmp = x * (t / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.1e+39) or not (t <= 1.16e+71): tmp = x * (t / (z + -1.0)) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.1e+39) || !(t <= 1.16e+71)) tmp = Float64(x * Float64(t / Float64(z + -1.0))); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.1e+39) || ~((t <= 1.16e+71))) tmp = x * (t / (z + -1.0)); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.1e+39], N[Not[LessEqual[t, 1.16e+71]], $MachinePrecision]], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+39} \lor \neg \left(t \leq 1.16 \cdot 10^{+71}\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -3.1000000000000003e39 or 1.1599999999999999e71 < t Initial program 96.0%
Taylor expanded in y around 0 69.5%
associate-*r/69.5%
associate-*r*69.5%
neg-mul-169.5%
associate-*l/77.0%
*-commutative77.0%
distribute-frac-neg77.0%
mul-1-neg77.0%
associate-*r/77.0%
*-commutative77.0%
associate-*r/76.9%
metadata-eval76.9%
associate-/r*76.9%
neg-mul-176.9%
associate-*r/77.0%
*-rgt-identity77.0%
neg-sub077.0%
associate--r-77.0%
metadata-eval77.0%
Simplified77.0%
if -3.1000000000000003e39 < t < 1.1599999999999999e71Initial program 94.5%
frac-2neg94.5%
div-inv94.4%
fma-neg94.4%
distribute-neg-frac94.4%
Applied egg-rr94.4%
fma-udef94.4%
+-commutative94.4%
distribute-lft-neg-out94.4%
unsub-neg94.4%
neg-mul-194.4%
*-commutative94.4%
associate-*r/94.4%
metadata-eval94.4%
associate-/r*94.4%
neg-mul-194.4%
associate-*r/94.4%
*-rgt-identity94.4%
neg-sub094.4%
associate--r-94.4%
metadata-eval94.4%
neg-mul-194.4%
associate-/r*94.4%
metadata-eval94.4%
Simplified94.4%
Taylor expanded in t around 0 78.1%
associate-/l*81.0%
Simplified81.0%
Final simplification79.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1700.0) (not (<= z 5.8e-8))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1700.0) || !(z <= 5.8e-8)) {
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 <= (-1700.0d0)) .or. (.not. (z <= 5.8d-8))) 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 <= -1700.0) || !(z <= 5.8e-8)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1700.0) or not (z <= 5.8e-8): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1700.0) || !(z <= 5.8e-8)) 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 <= -1700.0) || ~((z <= 5.8e-8))) 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, -1700.0], N[Not[LessEqual[z, 5.8e-8]], $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 -1700 \lor \neg \left(z \leq 5.8 \cdot 10^{-8}\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -1700 or 5.8000000000000003e-8 < z Initial program 96.7%
Taylor expanded in z around inf 96.2%
cancel-sign-sub-inv96.2%
metadata-eval96.2%
*-lft-identity96.2%
+-commutative96.2%
Simplified96.2%
if -1700 < z < 5.8000000000000003e-8Initial program 93.8%
Taylor expanded in z around 0 91.8%
+-commutative91.8%
associate-*r/91.5%
*-commutative91.5%
associate-*r*91.5%
neg-mul-191.5%
distribute-rgt-out92.9%
unsub-neg92.9%
Simplified92.9%
Final simplification94.4%
(FPCore (x y z t) :precision binary64 (if (<= z -1700.0) (/ x (/ z (+ y t))) (if (<= z 5.8e-8) (* x (- (/ y z) t)) (* x (/ (+ y t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1700.0) {
tmp = x / (z / (y + t));
} else if (z <= 5.8e-8) {
tmp = x * ((y / z) - t);
} else {
tmp = x * ((y + t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1700.0d0)) then
tmp = x / (z / (y + t))
else if (z <= 5.8d-8) then
tmp = x * ((y / z) - t)
else
tmp = x * ((y + t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1700.0) {
tmp = x / (z / (y + t));
} else if (z <= 5.8e-8) {
tmp = x * ((y / z) - t);
} else {
tmp = x * ((y + t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1700.0: tmp = x / (z / (y + t)) elif z <= 5.8e-8: tmp = x * ((y / z) - t) else: tmp = x * ((y + t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1700.0) tmp = Float64(x / Float64(z / Float64(y + t))); elseif (z <= 5.8e-8) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(x * Float64(Float64(y + t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1700.0) tmp = x / (z / (y + t)); elseif (z <= 5.8e-8) tmp = x * ((y / z) - t); else tmp = x * ((y + t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1700.0], N[(x / N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-8], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1700:\\
\;\;\;\;\frac{x}{\frac{z}{y + t}}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-8}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\end{array}
\end{array}
if z < -1700Initial program 98.2%
Taylor expanded in z around inf 97.3%
cancel-sign-sub-inv97.3%
metadata-eval97.3%
*-lft-identity97.3%
+-commutative97.3%
Simplified97.3%
associate-*r/81.9%
+-commutative81.9%
*-un-lft-identity81.9%
metadata-eval81.9%
cancel-sign-sub-inv81.9%
associate-/l*97.3%
cancel-sign-sub-inv97.3%
metadata-eval97.3%
*-un-lft-identity97.3%
+-commutative97.3%
Applied egg-rr97.3%
if -1700 < z < 5.8000000000000003e-8Initial program 93.8%
Taylor expanded in z around 0 91.8%
+-commutative91.8%
associate-*r/91.5%
*-commutative91.5%
associate-*r*91.5%
neg-mul-191.5%
distribute-rgt-out92.9%
unsub-neg92.9%
Simplified92.9%
if 5.8000000000000003e-8 < z Initial program 95.0%
Taylor expanded in z around inf 95.0%
cancel-sign-sub-inv95.0%
metadata-eval95.0%
*-lft-identity95.0%
+-commutative95.0%
Simplified95.0%
Final simplification94.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.05e+182) (not (<= t 3.9e+111))) (* x (- t)) (* x (/ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.05e+182) || !(t <= 3.9e+111)) {
tmp = x * -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 ((t <= (-1.05d+182)) .or. (.not. (t <= 3.9d+111))) then
tmp = x * -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 ((t <= -1.05e+182) || !(t <= 3.9e+111)) {
tmp = x * -t;
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.05e+182) or not (t <= 3.9e+111): tmp = x * -t else: tmp = x * (y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.05e+182) || !(t <= 3.9e+111)) tmp = Float64(x * Float64(-t)); else tmp = Float64(x * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.05e+182) || ~((t <= 3.9e+111))) tmp = x * -t; else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.05e+182], N[Not[LessEqual[t, 3.9e+111]], $MachinePrecision]], N[(x * (-t)), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+182} \lor \neg \left(t \leq 3.9 \cdot 10^{+111}\right):\\
\;\;\;\;x \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if t < -1.0499999999999999e182 or 3.89999999999999979e111 < t Initial program 94.1%
Taylor expanded in z around 0 54.4%
+-commutative54.4%
associate-*r/48.8%
*-commutative48.8%
associate-*r*48.8%
neg-mul-148.8%
distribute-rgt-out51.8%
unsub-neg51.8%
Simplified51.8%
Taylor expanded in y around 0 44.1%
associate-*r*44.1%
neg-mul-144.1%
Simplified44.1%
if -1.0499999999999999e182 < t < 3.89999999999999979e111Initial program 95.5%
Taylor expanded in y around inf 69.2%
associate-*r/72.2%
Simplified72.2%
Final simplification65.0%
(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 95.1%
Taylor expanded in z around 0 65.5%
+-commutative65.5%
associate-*r/66.5%
*-commutative66.5%
associate-*r*66.5%
neg-mul-166.5%
distribute-rgt-out67.6%
unsub-neg67.6%
Simplified67.6%
Taylor expanded in y around 0 22.1%
associate-*r*22.1%
neg-mul-122.1%
Simplified22.1%
Final simplification22.1%
(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 2023271
(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)))))