
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
(FPCore (x y z t) :precision binary64 (* x (+ (/ y z) (/ t (+ z -1.0)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) + (t / (z + -1.0)));
}
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 / (z + (-1.0d0))))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) + (t / (z + -1.0)));
}
def code(x, y, z, t): return x * ((y / z) + (t / (z + -1.0)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) + Float64(t / Float64(z + -1.0)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) + (t / (z + -1.0))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} + \frac{t}{z + -1}\right)
\end{array}
Initial program 96.1%
Final simplification96.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -6.2e+183)
(* x (/ y z))
(if (or (<= z -7.3e+140) (not (<= z 2.2e+39)))
(* x (/ t z))
(* x (- (/ y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.2e+183) {
tmp = x * (y / z);
} else if ((z <= -7.3e+140) || !(z <= 2.2e+39)) {
tmp = x * (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 <= (-6.2d+183)) then
tmp = x * (y / z)
else if ((z <= (-7.3d+140)) .or. (.not. (z <= 2.2d+39))) then
tmp = x * (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 <= -6.2e+183) {
tmp = x * (y / z);
} else if ((z <= -7.3e+140) || !(z <= 2.2e+39)) {
tmp = x * (t / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.2e+183: tmp = x * (y / z) elif (z <= -7.3e+140) or not (z <= 2.2e+39): tmp = x * (t / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.2e+183) tmp = Float64(x * Float64(y / z)); elseif ((z <= -7.3e+140) || !(z <= 2.2e+39)) tmp = Float64(x * Float64(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 <= -6.2e+183) tmp = x * (y / z); elseif ((z <= -7.3e+140) || ~((z <= 2.2e+39))) tmp = x * (t / z); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.2e+183], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -7.3e+140], N[Not[LessEqual[z, 2.2e+39]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+183}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq -7.3 \cdot 10^{+140} \lor \neg \left(z \leq 2.2 \cdot 10^{+39}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -6.1999999999999997e183Initial program 99.5%
Taylor expanded in y around inf 64.6%
associate-*r/72.2%
Simplified72.2%
if -6.1999999999999997e183 < z < -7.3000000000000004e140 or 2.2000000000000001e39 < z Initial program 96.0%
Taylor expanded in y around 0 64.6%
mul-1-neg64.6%
distribute-neg-frac264.6%
neg-sub064.6%
associate--r-64.6%
metadata-eval64.6%
Simplified64.6%
Taylor expanded in z around inf 64.6%
if -7.3000000000000004e140 < z < 2.2000000000000001e39Initial program 95.6%
Taylor expanded in z around 0 86.1%
Final simplification78.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -0.85) (not (<= z 2.3e-12))) (* x (/ (+ y t) z)) (/ (* x (- y (* z t))) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.85) || !(z <= 2.3e-12)) {
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 <= (-0.85d0)) .or. (.not. (z <= 2.3d-12))) 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 <= -0.85) || !(z <= 2.3e-12)) {
tmp = x * ((y + t) / z);
} else {
tmp = (x * (y - (z * t))) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.85) or not (z <= 2.3e-12): 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 <= -0.85) || !(z <= 2.3e-12)) 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 <= -0.85) || ~((z <= 2.3e-12))) 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, -0.85], N[Not[LessEqual[z, 2.3e-12]], $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 -0.85 \lor \neg \left(z \leq 2.3 \cdot 10^{-12}\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 < -0.849999999999999978 or 2.29999999999999989e-12 < z Initial program 97.6%
Taylor expanded in z around inf 84.9%
associate-/l*95.9%
cancel-sign-sub-inv95.9%
metadata-eval95.9%
*-lft-identity95.9%
+-commutative95.9%
Simplified95.9%
if -0.849999999999999978 < z < 2.29999999999999989e-12Initial program 94.5%
add-cube-cbrt93.5%
pow393.5%
Applied egg-rr93.5%
rem-cube-cbrt94.5%
sub-neg94.5%
distribute-frac-neg94.5%
distribute-rgt-out93.7%
add-sqr-sqrt47.2%
sqrt-unprod68.0%
sqr-neg68.0%
sqrt-unprod27.9%
add-sqr-sqrt63.6%
frac-2neg63.6%
distribute-frac-neg263.6%
cancel-sign-sub-inv63.6%
*-commutative63.6%
*-commutative63.6%
Applied egg-rr93.7%
Taylor expanded in z around 0 88.5%
neg-mul-188.5%
+-commutative88.5%
sub-neg88.5%
*-commutative88.5%
associate-*r*93.3%
div-sub93.3%
associate-*r/92.9%
associate-/l*93.0%
distribute-lft-out--93.8%
div-sub93.8%
*-commutative93.8%
associate-/l*94.1%
*-commutative94.1%
Simplified94.1%
Final simplification95.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 2.3e-12))) (* 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.3e-12)) {
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.3d-12))) 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.3e-12)) {
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.3e-12): 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.3e-12)) 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.3e-12))) 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.3e-12]], $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.3 \cdot 10^{-12}\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.29999999999999989e-12 < z Initial program 97.6%
Taylor expanded in z around inf 84.9%
associate-/l*95.9%
cancel-sign-sub-inv95.9%
metadata-eval95.9%
*-lft-identity95.9%
+-commutative95.9%
Simplified95.9%
if -1 < z < 2.29999999999999989e-12Initial program 94.5%
Taylor expanded in z around 0 93.8%
Final simplification94.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.2e+150) (not (<= t 4.4e+87))) (* x (/ t (+ z -1.0))) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.2e+150) || !(t <= 4.4e+87)) {
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.2d+150)) .or. (.not. (t <= 4.4d+87))) 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.2e+150) || !(t <= 4.4e+87)) {
tmp = x * (t / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.2e+150) or not (t <= 4.4e+87): 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.2e+150) || !(t <= 4.4e+87)) 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.2e+150) || ~((t <= 4.4e+87))) 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.2e+150], N[Not[LessEqual[t, 4.4e+87]], $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.2 \cdot 10^{+150} \lor \neg \left(t \leq 4.4 \cdot 10^{+87}\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -3.20000000000000016e150 or 4.4000000000000002e87 < t Initial program 98.6%
Taylor expanded in y around 0 85.1%
mul-1-neg85.1%
distribute-neg-frac285.1%
neg-sub085.1%
associate--r-85.1%
metadata-eval85.1%
Simplified85.1%
if -3.20000000000000016e150 < t < 4.4000000000000002e87Initial program 95.0%
Taylor expanded in y around inf 73.3%
associate-*r/77.5%
Simplified77.5%
clear-num77.4%
un-div-inv77.7%
Applied egg-rr77.7%
Final simplification80.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9.5e+150) (not (<= t 1.12e+86))) (* t (/ x (+ z -1.0))) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9.5e+150) || !(t <= 1.12e+86)) {
tmp = t * (x / (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 <= (-9.5d+150)) .or. (.not. (t <= 1.12d+86))) then
tmp = t * (x / (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 <= -9.5e+150) || !(t <= 1.12e+86)) {
tmp = t * (x / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9.5e+150) or not (t <= 1.12e+86): tmp = t * (x / (z + -1.0)) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9.5e+150) || !(t <= 1.12e+86)) tmp = Float64(t * Float64(x / 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 <= -9.5e+150) || ~((t <= 1.12e+86))) tmp = t * (x / (z + -1.0)); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9.5e+150], N[Not[LessEqual[t, 1.12e+86]], $MachinePrecision]], N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+150} \lor \neg \left(t \leq 1.12 \cdot 10^{+86}\right):\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -9.5000000000000001e150 or 1.12e86 < t Initial program 98.6%
Taylor expanded in y around 0 77.9%
mul-1-neg77.9%
associate-/l*74.1%
distribute-rgt-neg-in74.1%
distribute-neg-frac274.1%
neg-sub074.1%
associate--r-74.1%
metadata-eval74.1%
Simplified74.1%
if -9.5000000000000001e150 < t < 1.12e86Initial program 95.0%
Taylor expanded in y around inf 73.3%
associate-*r/77.5%
Simplified77.5%
clear-num77.4%
un-div-inv77.7%
Applied egg-rr77.7%
Final simplification76.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.8e+150) (not (<= t 1.7e+90))) (/ x (/ z t)) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.8e+150) || !(t <= 1.7e+90)) {
tmp = x / (z / t);
} else {
tmp = x / (z / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-4.8d+150)) .or. (.not. (t <= 1.7d+90))) then
tmp = x / (z / t)
else
tmp = x / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.8e+150) || !(t <= 1.7e+90)) {
tmp = x / (z / t);
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.8e+150) or not (t <= 1.7e+90): tmp = x / (z / t) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.8e+150) || !(t <= 1.7e+90)) tmp = Float64(x / Float64(z / t)); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.8e+150) || ~((t <= 1.7e+90))) tmp = x / (z / t); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.8e+150], N[Not[LessEqual[t, 1.7e+90]], $MachinePrecision]], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+150} \lor \neg \left(t \leq 1.7 \cdot 10^{+90}\right):\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -4.80000000000000005e150 or 1.70000000000000009e90 < t Initial program 98.6%
add-cube-cbrt97.2%
pow397.2%
Applied egg-rr97.2%
Taylor expanded in z around inf 62.3%
associate-/l*72.9%
cancel-sign-sub-inv72.9%
metadata-eval72.9%
*-lft-identity72.9%
Simplified72.9%
clear-num72.8%
un-div-inv73.0%
Applied egg-rr73.0%
Taylor expanded in y around 0 64.6%
if -4.80000000000000005e150 < t < 1.70000000000000009e90Initial program 95.0%
Taylor expanded in y around inf 73.3%
associate-*r/77.5%
Simplified77.5%
clear-num77.4%
un-div-inv77.7%
Applied egg-rr77.7%
Final simplification73.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.4e+149) (not (<= t 1e+90))) (/ x (/ z t)) (* x (/ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.4e+149) || !(t <= 1e+90)) {
tmp = x / (z / t);
} else {
tmp = x * (y / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-5.4d+149)) .or. (.not. (t <= 1d+90))) then
tmp = x / (z / t)
else
tmp = x * (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.4e+149) || !(t <= 1e+90)) {
tmp = x / (z / t);
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.4e+149) or not (t <= 1e+90): tmp = x / (z / t) else: tmp = x * (y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.4e+149) || !(t <= 1e+90)) tmp = Float64(x / Float64(z / 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 <= -5.4e+149) || ~((t <= 1e+90))) tmp = x / (z / t); else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.4e+149], N[Not[LessEqual[t, 1e+90]], $MachinePrecision]], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{+149} \lor \neg \left(t \leq 10^{+90}\right):\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if t < -5.4000000000000002e149 or 9.99999999999999966e89 < t Initial program 98.6%
add-cube-cbrt97.2%
pow397.2%
Applied egg-rr97.2%
Taylor expanded in z around inf 62.3%
associate-/l*72.9%
cancel-sign-sub-inv72.9%
metadata-eval72.9%
*-lft-identity72.9%
Simplified72.9%
clear-num72.8%
un-div-inv73.0%
Applied egg-rr73.0%
Taylor expanded in y around 0 64.6%
if -5.4000000000000002e149 < t < 9.99999999999999966e89Initial program 95.0%
Taylor expanded in y around inf 73.3%
associate-*r/77.5%
Simplified77.5%
Final simplification73.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.1e+152) (not (<= t 1.3e+89))) (* x (/ t z)) (* x (/ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.1e+152) || !(t <= 1.3e+89)) {
tmp = x * (t / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-2.1d+152)) .or. (.not. (t <= 1.3d+89))) then
tmp = x * (t / z)
else
tmp = x * (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.1e+152) || !(t <= 1.3e+89)) {
tmp = x * (t / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.1e+152) or not (t <= 1.3e+89): tmp = x * (t / z) else: tmp = x * (y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.1e+152) || !(t <= 1.3e+89)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.1e+152) || ~((t <= 1.3e+89))) tmp = x * (t / z); else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.1e+152], N[Not[LessEqual[t, 1.3e+89]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+152} \lor \neg \left(t \leq 1.3 \cdot 10^{+89}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if t < -2.1000000000000002e152 or 1.3e89 < t Initial program 98.6%
Taylor expanded in y around 0 85.1%
mul-1-neg85.1%
distribute-neg-frac285.1%
neg-sub085.1%
associate--r-85.1%
metadata-eval85.1%
Simplified85.1%
Taylor expanded in z around inf 64.5%
if -2.1000000000000002e152 < t < 1.3e89Initial program 95.0%
Taylor expanded in y around inf 73.3%
associate-*r/77.5%
Simplified77.5%
Final simplification73.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 2.3e-12))) (* x (/ t z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 2.3e-12)) {
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 <= 2.3d-12))) 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 <= 2.3e-12)) {
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 <= 2.3e-12): tmp = x * (t / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 2.3e-12)) 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 <= 2.3e-12))) 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, 2.3e-12]], $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 2.3 \cdot 10^{-12}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -1 or 2.29999999999999989e-12 < z Initial program 97.6%
Taylor expanded in y around 0 58.4%
mul-1-neg58.4%
distribute-neg-frac258.4%
neg-sub058.4%
associate--r-58.4%
metadata-eval58.4%
Simplified58.4%
Taylor expanded in z around inf 56.7%
if -1 < z < 2.29999999999999989e-12Initial program 94.5%
Taylor expanded in y around 0 34.8%
mul-1-neg34.8%
distribute-neg-frac234.8%
neg-sub034.8%
associate--r-34.8%
metadata-eval34.8%
Simplified34.8%
Taylor expanded in z around 0 34.1%
*-commutative34.1%
neg-mul-134.1%
distribute-rgt-neg-in34.1%
Simplified34.1%
Final simplification46.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 2.3e-12))) (* t (/ x z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 2.3e-12)) {
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 <= (-1.0d0)) .or. (.not. (z <= 2.3d-12))) 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 <= -1.0) || !(z <= 2.3e-12)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 2.3e-12): tmp = t * (x / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 2.3e-12)) 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 <= -1.0) || ~((z <= 2.3e-12))) tmp = t * (x / 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, 2.3e-12]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 2.3 \cdot 10^{-12}\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -1 or 2.29999999999999989e-12 < z Initial program 97.6%
Taylor expanded in y around 0 58.4%
mul-1-neg58.4%
distribute-neg-frac258.4%
neg-sub058.4%
associate--r-58.4%
metadata-eval58.4%
Simplified58.4%
Taylor expanded in z around inf 53.5%
associate-/l*50.7%
Simplified50.7%
if -1 < z < 2.29999999999999989e-12Initial program 94.5%
Taylor expanded in y around 0 34.8%
mul-1-neg34.8%
distribute-neg-frac234.8%
neg-sub034.8%
associate--r-34.8%
metadata-eval34.8%
Simplified34.8%
Taylor expanded in z around 0 34.1%
*-commutative34.1%
neg-mul-134.1%
distribute-rgt-neg-in34.1%
Simplified34.1%
Final simplification42.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 96.1%
Taylor expanded in y around 0 47.2%
mul-1-neg47.2%
distribute-neg-frac247.2%
neg-sub047.2%
associate--r-47.2%
metadata-eval47.2%
Simplified47.2%
Taylor expanded in z around 0 23.2%
*-commutative23.2%
neg-mul-123.2%
distribute-rgt-neg-in23.2%
Simplified23.2%
Final simplification23.2%
(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 * 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 t
\end{array}
Initial program 96.1%
Taylor expanded in y around 0 47.2%
mul-1-neg47.2%
distribute-neg-frac247.2%
neg-sub047.2%
associate--r-47.2%
metadata-eval47.2%
Simplified47.2%
Taylor expanded in z around 0 23.2%
*-commutative23.2%
neg-mul-123.2%
distribute-rgt-neg-in23.2%
Simplified23.2%
neg-sub023.2%
sub-neg23.2%
add-sqr-sqrt10.6%
sqrt-unprod13.7%
sqr-neg13.7%
sqrt-unprod4.3%
add-sqr-sqrt7.8%
Applied egg-rr7.8%
+-lft-identity7.8%
Simplified7.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 2024145
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:alt
(! :herbie-platform default (if (< (* x (- (/ y z) (/ t (- 1 z)))) -3811613151656021/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 7066972463851151/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z))))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))