
(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 14 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 (* (/ x z) y)) (t_2 (- (/ y z) (/ t (- 1.0 z))))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 4e+291) (* t_2 x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / z) * y;
double t_2 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 4e+291) {
tmp = t_2 * x;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) * y;
double t_2 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= 4e+291) {
tmp = t_2 * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) * y t_2 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= 4e+291: tmp = t_2 * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) * y) t_2 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 4e+291) tmp = Float64(t_2 * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) * y; t_2 = (y / z) - (t / (1.0 - z)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= 4e+291) tmp = t_2 * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 4e+291], N[(t$95$2 * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot y\\
t_2 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+291}:\\
\;\;\;\;t\_2 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0 or 3.9999999999999998e291 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 64.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f64N/A
sub-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f6464.8
Applied rewrites64.8%
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
unpow-1N/A
div-invN/A
lift-/.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
div-invN/A
metadata-evalN/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6497.2
Applied rewrites97.2%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 3.9999999999999998e291Initial program 98.5%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (<= x 2.2e-5) (fma (/ -1.0 z) (* (- y) x) (/ x (/ (- z 1.0) t))) (* (fma t (pow (- z 1.0) -1.0) (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.2e-5) {
tmp = fma((-1.0 / z), (-y * x), (x / ((z - 1.0) / t)));
} else {
tmp = fma(t, pow((z - 1.0), -1.0), (y / z)) * x;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= 2.2e-5) tmp = fma(Float64(-1.0 / z), Float64(Float64(-y) * x), Float64(x / Float64(Float64(z - 1.0) / t))); else tmp = Float64(fma(t, (Float64(z - 1.0) ^ -1.0), Float64(y / z)) * x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, 2.2e-5], N[(N[(-1.0 / z), $MachinePrecision] * N[((-y) * x), $MachinePrecision] + N[(x / N[(N[(z - 1.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[Power[N[(z - 1.0), $MachinePrecision], -1.0], $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.2 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{z}, \left(-y\right) \cdot x, \frac{x}{\frac{z - 1}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, {\left(z - 1\right)}^{-1}, \frac{y}{z}\right) \cdot x\\
\end{array}
\end{array}
if x < 2.1999999999999999e-5Initial program 92.3%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f64N/A
sub-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f6492.3
Applied rewrites92.3%
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
unpow-1N/A
div-invN/A
lift-/.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
div-invN/A
metadata-evalN/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6495.0
Applied rewrites95.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6495.0
Applied rewrites95.0%
if 2.1999999999999999e-5 < x Initial program 97.3%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f64N/A
sub-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f6497.3
Applied rewrites97.3%
Final simplification95.6%
(FPCore (x y z t) :precision binary64 (if (<= x 3.25e+28) (fma (/ -1.0 z) (* (- y) x) (/ x (/ (- z 1.0) t))) (* (- (/ y z) (/ t (- 1.0 z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 3.25e+28) {
tmp = fma((-1.0 / z), (-y * x), (x / ((z - 1.0) / t)));
} else {
tmp = ((y / z) - (t / (1.0 - z))) * x;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= 3.25e+28) tmp = fma(Float64(-1.0 / z), Float64(Float64(-y) * x), Float64(x / Float64(Float64(z - 1.0) / t))); else tmp = Float64(Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) * x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, 3.25e+28], N[(N[(-1.0 / z), $MachinePrecision] * N[((-y) * x), $MachinePrecision] + N[(x / N[(N[(z - 1.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.25 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{z}, \left(-y\right) \cdot x, \frac{x}{\frac{z - 1}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y}{z} - \frac{t}{1 - z}\right) \cdot x\\
\end{array}
\end{array}
if x < 3.25e28Initial program 92.6%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f64N/A
sub-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f6492.6
Applied rewrites92.6%
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
unpow-1N/A
div-invN/A
lift-/.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
div-invN/A
metadata-evalN/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6495.1
Applied rewrites95.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6495.2
Applied rewrites95.2%
if 3.25e28 < x Initial program 97.0%
Final simplification95.6%
(FPCore (x y z t) :precision binary64 (if (<= x 2e-8) (fma (/ -1.0 z) (* (- y) x) (* (/ t (- z 1.0)) x)) (* (- (/ y z) (/ t (- 1.0 z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2e-8) {
tmp = fma((-1.0 / z), (-y * x), ((t / (z - 1.0)) * x));
} else {
tmp = ((y / z) - (t / (1.0 - z))) * x;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= 2e-8) tmp = fma(Float64(-1.0 / z), Float64(Float64(-y) * x), Float64(Float64(t / Float64(z - 1.0)) * x)); else tmp = Float64(Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) * x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, 2e-8], N[(N[(-1.0 / z), $MachinePrecision] * N[((-y) * x), $MachinePrecision] + N[(N[(t / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{z}, \left(-y\right) \cdot x, \frac{t}{z - 1} \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y}{z} - \frac{t}{1 - z}\right) \cdot x\\
\end{array}
\end{array}
if x < 2e-8Initial program 92.3%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f64N/A
sub-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f6492.3
Applied rewrites92.3%
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
unpow-1N/A
div-invN/A
lift-/.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
div-invN/A
metadata-evalN/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6495.0
Applied rewrites95.0%
if 2e-8 < x Initial program 97.3%
Final simplification95.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ (+ t y) z) x)))
(if (<= z -1.2e-9)
t_1
(if (<= z 1.08e-11) (fma (/ -1.0 z) (* (- y) x) (* (- t) x)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -1.2e-9) {
tmp = t_1;
} else if (z <= 1.08e-11) {
tmp = fma((-1.0 / z), (-y * x), (-t * x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(Float64(t + y) / z) * x) tmp = 0.0 if (z <= -1.2e-9) tmp = t_1; elseif (z <= 1.08e-11) tmp = fma(Float64(-1.0 / z), Float64(Float64(-y) * x), Float64(Float64(-t) * x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -1.2e-9], t$95$1, If[LessEqual[z, 1.08e-11], N[(N[(-1.0 / z), $MachinePrecision] * N[((-y) * x), $MachinePrecision] + N[((-t) * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t + y}{z} \cdot x\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{z}, \left(-y\right) \cdot x, \left(-t\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.2e-9 or 1.07999999999999992e-11 < z Initial program 97.8%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6496.6
Applied rewrites96.6%
if -1.2e-9 < z < 1.07999999999999992e-11Initial program 88.5%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f64N/A
sub-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f6488.5
Applied rewrites88.5%
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
unpow-1N/A
div-invN/A
lift-/.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
div-invN/A
metadata-evalN/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6496.3
Applied rewrites96.3%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6496.3
Applied rewrites96.3%
Final simplification96.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x z) t)) (t_2 (* (fma x z x) (- t))))
(if (<= z -0.75)
t_1
(if (<= z -1.8e-197)
t_2
(if (<= z 3.7e-181) t_1 (if (<= z 225000.0) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / z) * t;
double t_2 = fma(x, z, x) * -t;
double tmp;
if (z <= -0.75) {
tmp = t_1;
} else if (z <= -1.8e-197) {
tmp = t_2;
} else if (z <= 3.7e-181) {
tmp = t_1;
} else if (z <= 225000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x / z) * t) t_2 = Float64(fma(x, z, x) * Float64(-t)) tmp = 0.0 if (z <= -0.75) tmp = t_1; elseif (z <= -1.8e-197) tmp = t_2; elseif (z <= 3.7e-181) tmp = t_1; elseif (z <= 225000.0) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * z + x), $MachinePrecision] * (-t)), $MachinePrecision]}, If[LessEqual[z, -0.75], t$95$1, If[LessEqual[z, -1.8e-197], t$95$2, If[LessEqual[z, 3.7e-181], t$95$1, If[LessEqual[z, 225000.0], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot t\\
t_2 := \mathsf{fma}\left(x, z, x\right) \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -0.75:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-197}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 225000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.75 or -1.7999999999999999e-197 < z < 3.69999999999999984e-181 or 225000 < z Initial program 92.7%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
lower--.f6441.6
Applied rewrites41.6%
Taylor expanded in z around inf
Applied rewrites48.1%
if -0.75 < z < -1.7999999999999999e-197 or 3.69999999999999984e-181 < z < 225000Initial program 95.5%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
lower--.f6441.1
Applied rewrites41.1%
Taylor expanded in z around 0
Applied rewrites39.5%
Final simplification45.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ t z) x)))
(if (<= z -1.55e+264)
(* (/ y z) x)
(if (<= z -6.1e+63) t_1 (if (<= z 3.4e+25) (* (- (/ y z) t) x) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (t / z) * x;
double tmp;
if (z <= -1.55e+264) {
tmp = (y / z) * x;
} else if (z <= -6.1e+63) {
tmp = t_1;
} else if (z <= 3.4e+25) {
tmp = ((y / z) - 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 = (t / z) * x
if (z <= (-1.55d+264)) then
tmp = (y / z) * x
else if (z <= (-6.1d+63)) then
tmp = t_1
else if (z <= 3.4d+25) then
tmp = ((y / z) - 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 = (t / z) * x;
double tmp;
if (z <= -1.55e+264) {
tmp = (y / z) * x;
} else if (z <= -6.1e+63) {
tmp = t_1;
} else if (z <= 3.4e+25) {
tmp = ((y / z) - t) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t / z) * x tmp = 0 if z <= -1.55e+264: tmp = (y / z) * x elif z <= -6.1e+63: tmp = t_1 elif z <= 3.4e+25: tmp = ((y / z) - t) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t / z) * x) tmp = 0.0 if (z <= -1.55e+264) tmp = Float64(Float64(y / z) * x); elseif (z <= -6.1e+63) tmp = t_1; elseif (z <= 3.4e+25) tmp = Float64(Float64(Float64(y / z) - t) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t / z) * x; tmp = 0.0; if (z <= -1.55e+264) tmp = (y / z) * x; elseif (z <= -6.1e+63) tmp = t_1; elseif (z <= 3.4e+25) tmp = ((y / z) - t) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -1.55e+264], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, -6.1e+63], t$95$1, If[LessEqual[z, 3.4e+25], N[(N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{z} \cdot x\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+264}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;z \leq -6.1 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+25}:\\
\;\;\;\;\left(\frac{y}{z} - t\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.54999999999999991e264Initial program 99.7%
Taylor expanded in y around inf
lower-/.f6481.9
Applied rewrites81.9%
if -1.54999999999999991e264 < z < -6.09999999999999968e63 or 3.39999999999999984e25 < z Initial program 96.8%
Taylor expanded in y around inf
lower-/.f6448.3
Applied rewrites48.3%
Taylor expanded in z around inf
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6496.8
Applied rewrites96.8%
Taylor expanded in y around 0
Applied rewrites66.8%
if -6.09999999999999968e63 < z < 3.39999999999999984e25Initial program 91.0%
Taylor expanded in z around 0
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6486.3
Applied rewrites86.3%
Taylor expanded in y around 0
Applied rewrites86.4%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ (+ t y) z) x))) (if (<= z -0.88) t_1 (if (<= z 1.08e-11) (/ (* (- y (* t z)) x) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -0.88) {
tmp = t_1;
} else if (z <= 1.08e-11) {
tmp = ((y - (t * z)) * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ((t + y) / z) * x
if (z <= (-0.88d0)) then
tmp = t_1
else if (z <= 1.08d-11) then
tmp = ((y - (t * z)) * x) / z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -0.88) {
tmp = t_1;
} else if (z <= 1.08e-11) {
tmp = ((y - (t * z)) * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((t + y) / z) * x tmp = 0 if z <= -0.88: tmp = t_1 elif z <= 1.08e-11: tmp = ((y - (t * z)) * x) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(t + y) / z) * x) tmp = 0.0 if (z <= -0.88) tmp = t_1; elseif (z <= 1.08e-11) tmp = Float64(Float64(Float64(y - Float64(t * z)) * x) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((t + y) / z) * x; tmp = 0.0; if (z <= -0.88) tmp = t_1; elseif (z <= 1.08e-11) tmp = ((y - (t * z)) * x) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -0.88], t$95$1, If[LessEqual[z, 1.08e-11], N[(N[(N[(y - N[(t * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t + y}{z} \cdot x\\
\mathbf{if}\;z \leq -0.88:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{-11}:\\
\;\;\;\;\frac{\left(y - t \cdot z\right) \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.880000000000000004 or 1.07999999999999992e-11 < z Initial program 97.7%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6497.7
Applied rewrites97.7%
if -0.880000000000000004 < z < 1.07999999999999992e-11Initial program 89.2%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
unsub-negN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6494.5
Applied rewrites94.5%
Final simplification96.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ (+ t y) z) x))) (if (<= z -1.6e+25) t_1 (if (<= z 1.08e-11) (* (- (/ y z) t) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -1.6e+25) {
tmp = t_1;
} else if (z <= 1.08e-11) {
tmp = ((y / z) - 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 = ((t + y) / z) * x
if (z <= (-1.6d+25)) then
tmp = t_1
else if (z <= 1.08d-11) then
tmp = ((y / z) - 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 = ((t + y) / z) * x;
double tmp;
if (z <= -1.6e+25) {
tmp = t_1;
} else if (z <= 1.08e-11) {
tmp = ((y / z) - t) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((t + y) / z) * x tmp = 0 if z <= -1.6e+25: tmp = t_1 elif z <= 1.08e-11: tmp = ((y / z) - t) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(t + y) / z) * x) tmp = 0.0 if (z <= -1.6e+25) tmp = t_1; elseif (z <= 1.08e-11) tmp = Float64(Float64(Float64(y / z) - t) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((t + y) / z) * x; tmp = 0.0; if (z <= -1.6e+25) tmp = t_1; elseif (z <= 1.08e-11) tmp = ((y / z) - t) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -1.6e+25], t$95$1, If[LessEqual[z, 1.08e-11], N[(N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t + y}{z} \cdot x\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{-11}:\\
\;\;\;\;\left(\frac{y}{z} - t\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.6e25 or 1.07999999999999992e-11 < z Initial program 97.6%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6497.6
Applied rewrites97.6%
if -1.6e25 < z < 1.07999999999999992e-11Initial program 89.4%
Taylor expanded in z around 0
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6488.2
Applied rewrites88.2%
Taylor expanded in y around 0
Applied rewrites88.2%
Final simplification93.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* t x) (- z 1.0)))) (if (<= t -2.3e+123) t_1 (if (<= t 7.6e+106) (* (/ x z) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (t * x) / (z - 1.0);
double tmp;
if (t <= -2.3e+123) {
tmp = t_1;
} else if (t <= 7.6e+106) {
tmp = (x / z) * y;
} 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 = (t * x) / (z - 1.0d0)
if (t <= (-2.3d+123)) then
tmp = t_1
else if (t <= 7.6d+106) then
tmp = (x / z) * y
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 = (t * x) / (z - 1.0);
double tmp;
if (t <= -2.3e+123) {
tmp = t_1;
} else if (t <= 7.6e+106) {
tmp = (x / z) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t * x) / (z - 1.0) tmp = 0 if t <= -2.3e+123: tmp = t_1 elif t <= 7.6e+106: tmp = (x / z) * y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t * x) / Float64(z - 1.0)) tmp = 0.0 if (t <= -2.3e+123) tmp = t_1; elseif (t <= 7.6e+106) tmp = Float64(Float64(x / z) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t * x) / (z - 1.0); tmp = 0.0; if (t <= -2.3e+123) tmp = t_1; elseif (t <= 7.6e+106) tmp = (x / z) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t * x), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.3e+123], t$95$1, If[LessEqual[t, 7.6e+106], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot x}{z - 1}\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{+106}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.2999999999999999e123 or 7.5999999999999996e106 < t Initial program 96.1%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
lower--.f6472.8
Applied rewrites72.8%
if -2.2999999999999999e123 < t < 7.5999999999999996e106Initial program 92.6%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f64N/A
sub-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f6492.6
Applied rewrites92.6%
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
unpow-1N/A
div-invN/A
lift-/.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
div-invN/A
metadata-evalN/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6492.2
Applied rewrites92.2%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f6479.3
Applied rewrites79.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ t z) x))) (if (<= t -7.2e+131) t_1 (if (<= t 2.1e+133) (* (/ x z) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (t / z) * x;
double tmp;
if (t <= -7.2e+131) {
tmp = t_1;
} else if (t <= 2.1e+133) {
tmp = (x / z) * y;
} 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 = (t / z) * x
if (t <= (-7.2d+131)) then
tmp = t_1
else if (t <= 2.1d+133) then
tmp = (x / z) * y
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 = (t / z) * x;
double tmp;
if (t <= -7.2e+131) {
tmp = t_1;
} else if (t <= 2.1e+133) {
tmp = (x / z) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t / z) * x tmp = 0 if t <= -7.2e+131: tmp = t_1 elif t <= 2.1e+133: tmp = (x / z) * y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t / z) * x) tmp = 0.0 if (t <= -7.2e+131) tmp = t_1; elseif (t <= 2.1e+133) tmp = Float64(Float64(x / z) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t / z) * x; tmp = 0.0; if (t <= -7.2e+131) tmp = t_1; elseif (t <= 2.1e+133) tmp = (x / z) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -7.2e+131], t$95$1, If[LessEqual[t, 2.1e+133], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{z} \cdot x\\
\mathbf{if}\;t \leq -7.2 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+133}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.20000000000000063e131 or 2.1e133 < t Initial program 95.8%
Taylor expanded in y around inf
lower-/.f6418.5
Applied rewrites18.5%
Taylor expanded in z around inf
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6473.6
Applied rewrites73.6%
Taylor expanded in y around 0
Applied rewrites66.2%
if -7.20000000000000063e131 < t < 2.1e133Initial program 92.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f64N/A
sub-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f6492.8
Applied rewrites92.8%
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
unpow-1N/A
div-invN/A
lift-/.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
div-invN/A
metadata-evalN/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6492.5
Applied rewrites92.5%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f6478.4
Applied rewrites78.4%
Final simplification75.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ x z) t))) (if (<= t -7.2e+131) t_1 (if (<= t 2.1e+133) (* (/ x z) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / z) * t;
double tmp;
if (t <= -7.2e+131) {
tmp = t_1;
} else if (t <= 2.1e+133) {
tmp = (x / z) * y;
} 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 / z) * t
if (t <= (-7.2d+131)) then
tmp = t_1
else if (t <= 2.1d+133) then
tmp = (x / z) * y
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 / z) * t;
double tmp;
if (t <= -7.2e+131) {
tmp = t_1;
} else if (t <= 2.1e+133) {
tmp = (x / z) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) * t tmp = 0 if t <= -7.2e+131: tmp = t_1 elif t <= 2.1e+133: tmp = (x / z) * y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) * t) tmp = 0.0 if (t <= -7.2e+131) tmp = t_1; elseif (t <= 2.1e+133) tmp = Float64(Float64(x / z) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) * t; tmp = 0.0; if (t <= -7.2e+131) tmp = t_1; elseif (t <= 2.1e+133) tmp = (x / z) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -7.2e+131], t$95$1, If[LessEqual[t, 2.1e+133], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot t\\
\mathbf{if}\;t \leq -7.2 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+133}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.20000000000000063e131 or 2.1e133 < t Initial program 95.8%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
lower--.f6473.1
Applied rewrites73.1%
Taylor expanded in z around inf
Applied rewrites56.3%
if -7.20000000000000063e131 < t < 2.1e133Initial program 92.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f64N/A
sub-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f6492.8
Applied rewrites92.8%
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
unpow-1N/A
div-invN/A
lift-/.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
div-invN/A
metadata-evalN/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6492.5
Applied rewrites92.5%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f6478.4
Applied rewrites78.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ x z) t))) (if (<= t -5.2e+131) t_1 (if (<= t 13000000.0) (/ (* y x) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / z) * t;
double tmp;
if (t <= -5.2e+131) {
tmp = t_1;
} else if (t <= 13000000.0) {
tmp = (y * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) * t
if (t <= (-5.2d+131)) then
tmp = t_1
else if (t <= 13000000.0d0) then
tmp = (y * x) / z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) * t;
double tmp;
if (t <= -5.2e+131) {
tmp = t_1;
} else if (t <= 13000000.0) {
tmp = (y * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) * t tmp = 0 if t <= -5.2e+131: tmp = t_1 elif t <= 13000000.0: tmp = (y * x) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) * t) tmp = 0.0 if (t <= -5.2e+131) tmp = t_1; elseif (t <= 13000000.0) tmp = Float64(Float64(y * x) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) * t; tmp = 0.0; if (t <= -5.2e+131) tmp = t_1; elseif (t <= 13000000.0) tmp = (y * x) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -5.2e+131], t$95$1, If[LessEqual[t, 13000000.0], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot t\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 13000000:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.2e131 or 1.3e7 < t Initial program 96.0%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
lower--.f6465.2
Applied rewrites65.2%
Taylor expanded in z around inf
Applied rewrites54.1%
if -5.2e131 < t < 1.3e7Initial program 92.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
cancel-sign-sub-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6482.3
Applied rewrites82.3%
Taylor expanded in z around 0
Applied rewrites74.7%
Taylor expanded in y around inf
Applied rewrites82.3%
Final simplification71.4%
(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(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}
\\
\left(-t\right) \cdot x
\end{array}
Initial program 93.6%
Taylor expanded in z around 0
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in y around 0
Applied rewrites21.3%
Final simplification21.3%
(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 2024276
(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)))))