
(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 15 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 (* (- (/ y z) (/ t (- 1.0 z))) x))
double code(double x, double y, double z, double t) {
return ((y / z) - (t / (1.0 - z))) * 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 = ((y / z) - (t / (1.0d0 - z))) * x
end function
public static double code(double x, double y, double z, double t) {
return ((y / z) - (t / (1.0 - z))) * x;
}
def code(x, y, z, t): return ((y / z) - (t / (1.0 - z))) * x
function code(x, y, z, t) return Float64(Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) * x) end
function tmp = code(x, y, z, t) tmp = ((y / z) - (t / (1.0 - z))) * x; end
code[x_, y_, z_, t_] := N[(N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{y}{z} - \frac{t}{1 - z}\right) \cdot x
\end{array}
Initial program 95.0%
Final simplification95.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ (+ t y) z) x)))
(if (<= z -7.5e-159)
t_1
(if (<= z 6.4e-79)
(/ (* y x) z)
(if (<= z 7.6e-29) (/ (* t x) (- z 1.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -7.5e-159) {
tmp = t_1;
} else if (z <= 6.4e-79) {
tmp = (y * x) / z;
} else if (z <= 7.6e-29) {
tmp = (t * x) / (z - 1.0);
} 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 <= (-7.5d-159)) then
tmp = t_1
else if (z <= 6.4d-79) then
tmp = (y * x) / z
else if (z <= 7.6d-29) then
tmp = (t * x) / (z - 1.0d0)
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 <= -7.5e-159) {
tmp = t_1;
} else if (z <= 6.4e-79) {
tmp = (y * x) / z;
} else if (z <= 7.6e-29) {
tmp = (t * x) / (z - 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((t + y) / z) * x tmp = 0 if z <= -7.5e-159: tmp = t_1 elif z <= 6.4e-79: tmp = (y * x) / z elif z <= 7.6e-29: tmp = (t * x) / (z - 1.0) 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 <= -7.5e-159) tmp = t_1; elseif (z <= 6.4e-79) tmp = Float64(Float64(y * x) / z); elseif (z <= 7.6e-29) tmp = Float64(Float64(t * x) / Float64(z - 1.0)); 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 <= -7.5e-159) tmp = t_1; elseif (z <= 6.4e-79) tmp = (y * x) / z; elseif (z <= 7.6e-29) tmp = (t * x) / (z - 1.0); 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, -7.5e-159], t$95$1, If[LessEqual[z, 6.4e-79], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 7.6e-29], N[(N[(t * x), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t + y}{z} \cdot x\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{-159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-79}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-29}:\\
\;\;\;\;\frac{t \cdot x}{z - 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.5e-159 or 7.59999999999999951e-29 < z Initial program 96.8%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6490.0
Applied rewrites90.0%
if -7.5e-159 < z < 6.39999999999999975e-79Initial program 90.9%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6472.6
Applied rewrites72.6%
if 6.39999999999999975e-79 < z < 7.59999999999999951e-29Initial program 100.0%
Taylor expanded in t around inf
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--.f6483.9
Applied rewrites83.9%
Final simplification84.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.0) (* (/ (+ t y) z) x) (if (<= z 1.0) (* (/ x z) (fma (- z) t y)) (/ x (/ z (+ t y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.0) {
tmp = ((t + y) / z) * x;
} else if (z <= 1.0) {
tmp = (x / z) * fma(-z, t, y);
} else {
tmp = x / (z / (t + y));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(Float64(t + y) / z) * x); elseif (z <= 1.0) tmp = Float64(Float64(x / z) * fma(Float64(-z), t, y)); else tmp = Float64(x / Float64(z / Float64(t + y))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.0], N[(N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x / z), $MachinePrecision] * N[((-z) * t + y), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{t + y}{z} \cdot x\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x}{z} \cdot \mathsf{fma}\left(-z, t, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{t + y}}\\
\end{array}
\end{array}
if z < -1Initial program 96.6%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6495.4
Applied rewrites95.4%
if -1 < z < 1Initial program 94.0%
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-/.f6495.3
Applied rewrites95.3%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6493.8
Applied rewrites93.8%
if 1 < z Initial program 95.6%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6495.5
Applied rewrites95.5%
Taylor expanded in z around inf
lower-/.f64N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
lower-+.f6494.3
Applied rewrites94.3%
Final simplification94.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ (+ t y) z) x))) (if (<= z -1.0) t_1 (if (<= z 1.8e-8) (* (/ x z) (fma (- z) t y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= 1.8e-8) {
tmp = (x / z) * fma(-z, t, y);
} 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.0) tmp = t_1; elseif (z <= 1.8e-8) tmp = Float64(Float64(x / z) * fma(Float64(-z), t, y)); 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.0], t$95$1, If[LessEqual[z, 1.8e-8], N[(N[(x / z), $MachinePrecision] * N[((-z) * t + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t + y}{z} \cdot x\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{z} \cdot \mathsf{fma}\left(-z, t, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1 or 1.79999999999999991e-8 < z Initial program 96.1%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6494.8
Applied rewrites94.8%
if -1 < z < 1.79999999999999991e-8Initial program 93.9%
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-/.f6495.3
Applied rewrites95.3%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6493.7
Applied rewrites93.7%
Final simplification94.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ (+ t y) z) x))) (if (<= z -1.0) t_1 (if (<= z 1.8e-8) (* (/ (- y (* t z)) z) 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.0) {
tmp = t_1;
} else if (z <= 1.8e-8) {
tmp = ((y - (t * z)) / z) * 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.0d0)) then
tmp = t_1
else if (z <= 1.8d-8) then
tmp = ((y - (t * z)) / z) * 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.0) {
tmp = t_1;
} else if (z <= 1.8e-8) {
tmp = ((y - (t * z)) / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((t + y) / z) * x tmp = 0 if z <= -1.0: tmp = t_1 elif z <= 1.8e-8: tmp = ((y - (t * z)) / z) * 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.0) tmp = t_1; elseif (z <= 1.8e-8) tmp = Float64(Float64(Float64(y - Float64(t * z)) / z) * 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.0) tmp = t_1; elseif (z <= 1.8e-8) tmp = ((y - (t * z)) / z) * 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.0], t$95$1, If[LessEqual[z, 1.8e-8], N[(N[(N[(y - N[(t * z), $MachinePrecision]), $MachinePrecision] / z), $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:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-8}:\\
\;\;\;\;\frac{y - t \cdot z}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1 or 1.79999999999999991e-8 < z Initial program 96.1%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6494.8
Applied rewrites94.8%
if -1 < z < 1.79999999999999991e-8Initial program 93.9%
Taylor expanded in z around 0
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6492.3
Applied rewrites92.3%
Final simplification93.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ t (- z 1.0)) x))) (if (<= t -1.08e+151) t_1 (if (<= t 4.9e+95) (/ (* (+ t y) x) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (t / (z - 1.0)) * x;
double tmp;
if (t <= -1.08e+151) {
tmp = t_1;
} else if (t <= 4.9e+95) {
tmp = ((t + 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 = (t / (z - 1.0d0)) * x
if (t <= (-1.08d+151)) then
tmp = t_1
else if (t <= 4.9d+95) then
tmp = ((t + 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 = (t / (z - 1.0)) * x;
double tmp;
if (t <= -1.08e+151) {
tmp = t_1;
} else if (t <= 4.9e+95) {
tmp = ((t + y) * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t / (z - 1.0)) * x tmp = 0 if t <= -1.08e+151: tmp = t_1 elif t <= 4.9e+95: tmp = ((t + y) * x) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t / Float64(z - 1.0)) * x) tmp = 0.0 if (t <= -1.08e+151) tmp = t_1; elseif (t <= 4.9e+95) tmp = Float64(Float64(Float64(t + y) * x) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t / (z - 1.0)) * x; tmp = 0.0; if (t <= -1.08e+151) tmp = t_1; elseif (t <= 4.9e+95) tmp = ((t + y) * x) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -1.08e+151], t$95$1, If[LessEqual[t, 4.9e+95], N[(N[(N[(t + y), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{z - 1} \cdot x\\
\mathbf{if}\;t \leq -1.08 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{+95}:\\
\;\;\;\;\frac{\left(t + y\right) \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.08000000000000003e151 or 4.8999999999999999e95 < t Initial program 95.2%
Taylor expanded in t around inf
mul-1-negN/A
distribute-neg-frac2N/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--.f6477.5
Applied rewrites77.5%
if -1.08000000000000003e151 < t < 4.8999999999999999e95Initial program 94.9%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6494.9
Applied rewrites94.9%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
lower-+.f6482.9
Applied rewrites82.9%
Final simplification81.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* t x) (- z 1.0)))) (if (<= t -3e-50) t_1 (if (<= t 7.8e+87) (* (/ y z) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (t * x) / (z - 1.0);
double tmp;
if (t <= -3e-50) {
tmp = t_1;
} else if (t <= 7.8e+87) {
tmp = (y / z) * 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 * x) / (z - 1.0d0)
if (t <= (-3d-50)) then
tmp = t_1
else if (t <= 7.8d+87) then
tmp = (y / z) * 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 * x) / (z - 1.0);
double tmp;
if (t <= -3e-50) {
tmp = t_1;
} else if (t <= 7.8e+87) {
tmp = (y / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t * x) / (z - 1.0) tmp = 0 if t <= -3e-50: tmp = t_1 elif t <= 7.8e+87: tmp = (y / z) * x 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 <= -3e-50) tmp = t_1; elseif (t <= 7.8e+87) tmp = Float64(Float64(y / z) * x); 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 <= -3e-50) tmp = t_1; elseif (t <= 7.8e+87) tmp = (y / z) * x; 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, -3e-50], t$95$1, If[LessEqual[t, 7.8e+87], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot x}{z - 1}\\
\mathbf{if}\;t \leq -3 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{+87}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.9999999999999999e-50 or 7.80000000000000039e87 < t Initial program 95.7%
Taylor expanded in t around inf
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--.f6471.7
Applied rewrites71.7%
if -2.9999999999999999e-50 < t < 7.80000000000000039e87Initial program 94.4%
Taylor expanded in t around 0
lower-/.f6484.4
Applied rewrites84.4%
Final simplification78.6%
(FPCore (x y z t) :precision binary64 (if (<= t -1.8e-49) (* (/ t z) x) (if (<= t 1.75e+107) (* (/ y z) x) (* (* (- -1.0 z) t) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.8e-49) {
tmp = (t / z) * x;
} else if (t <= 1.75e+107) {
tmp = (y / z) * x;
} else {
tmp = ((-1.0 - z) * 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 (t <= (-1.8d-49)) then
tmp = (t / z) * x
else if (t <= 1.75d+107) then
tmp = (y / z) * x
else
tmp = (((-1.0d0) - z) * t) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.8e-49) {
tmp = (t / z) * x;
} else if (t <= 1.75e+107) {
tmp = (y / z) * x;
} else {
tmp = ((-1.0 - z) * t) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.8e-49: tmp = (t / z) * x elif t <= 1.75e+107: tmp = (y / z) * x else: tmp = ((-1.0 - z) * t) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.8e-49) tmp = Float64(Float64(t / z) * x); elseif (t <= 1.75e+107) tmp = Float64(Float64(y / z) * x); else tmp = Float64(Float64(Float64(-1.0 - z) * t) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.8e-49) tmp = (t / z) * x; elseif (t <= 1.75e+107) tmp = (y / z) * x; else tmp = ((-1.0 - z) * t) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.8e-49], N[(N[(t / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 1.75e+107], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(-1.0 - z), $MachinePrecision] * t), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-49}:\\
\;\;\;\;\frac{t}{z} \cdot x\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+107}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-1 - z\right) \cdot t\right) \cdot x\\
\end{array}
\end{array}
if t < -1.79999999999999985e-49Initial program 94.3%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6471.5
Applied rewrites71.5%
Taylor expanded in t around inf
Applied rewrites58.9%
if -1.79999999999999985e-49 < t < 1.7499999999999999e107Initial program 94.6%
Taylor expanded in t around 0
lower-/.f6482.7
Applied rewrites82.7%
if 1.7499999999999999e107 < t Initial program 97.6%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6464.6
Applied rewrites64.6%
Taylor expanded in t around inf
Applied rewrites55.4%
Final simplification71.8%
(FPCore (x y z t) :precision binary64 (if (<= t -1.66e-49) (* (/ t z) x) (if (<= t 1.75e+107) (/ (* y x) z) (* (* (- -1.0 z) t) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.66e-49) {
tmp = (t / z) * x;
} else if (t <= 1.75e+107) {
tmp = (y * x) / z;
} else {
tmp = ((-1.0 - z) * 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 (t <= (-1.66d-49)) then
tmp = (t / z) * x
else if (t <= 1.75d+107) then
tmp = (y * x) / z
else
tmp = (((-1.0d0) - z) * t) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.66e-49) {
tmp = (t / z) * x;
} else if (t <= 1.75e+107) {
tmp = (y * x) / z;
} else {
tmp = ((-1.0 - z) * t) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.66e-49: tmp = (t / z) * x elif t <= 1.75e+107: tmp = (y * x) / z else: tmp = ((-1.0 - z) * t) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.66e-49) tmp = Float64(Float64(t / z) * x); elseif (t <= 1.75e+107) tmp = Float64(Float64(y * x) / z); else tmp = Float64(Float64(Float64(-1.0 - z) * t) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.66e-49) tmp = (t / z) * x; elseif (t <= 1.75e+107) tmp = (y * x) / z; else tmp = ((-1.0 - z) * t) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.66e-49], N[(N[(t / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 1.75e+107], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(-1.0 - z), $MachinePrecision] * t), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.66 \cdot 10^{-49}:\\
\;\;\;\;\frac{t}{z} \cdot x\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+107}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-1 - z\right) \cdot t\right) \cdot x\\
\end{array}
\end{array}
if t < -1.6599999999999999e-49Initial program 94.3%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6471.5
Applied rewrites71.5%
Taylor expanded in t around inf
Applied rewrites58.9%
if -1.6599999999999999e-49 < t < 1.7499999999999999e107Initial program 94.6%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6480.7
Applied rewrites80.7%
if 1.7499999999999999e107 < t Initial program 97.6%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6464.6
Applied rewrites64.6%
Taylor expanded in t around inf
Applied rewrites55.4%
Final simplification70.7%
(FPCore (x y z t) :precision binary64 (if (<= t 1.2e+88) (/ (* (+ t y) x) z) (/ (* t x) (- z 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.2e+88) {
tmp = ((t + y) * x) / z;
} else {
tmp = (t * x) / (z - 1.0);
}
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.2d+88) then
tmp = ((t + y) * x) / z
else
tmp = (t * x) / (z - 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.2e+88) {
tmp = ((t + y) * x) / z;
} else {
tmp = (t * x) / (z - 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.2e+88: tmp = ((t + y) * x) / z else: tmp = (t * x) / (z - 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.2e+88) tmp = Float64(Float64(Float64(t + y) * x) / z); else tmp = Float64(Float64(t * x) / Float64(z - 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.2e+88) tmp = ((t + y) * x) / z; else tmp = (t * x) / (z - 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.2e+88], N[(N[(N[(t + y), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision], N[(N[(t * x), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.2 \cdot 10^{+88}:\\
\;\;\;\;\frac{\left(t + y\right) \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot x}{z - 1}\\
\end{array}
\end{array}
if t < 1.2e88Initial program 94.4%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6494.3
Applied rewrites94.3%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
lower-+.f6478.4
Applied rewrites78.4%
if 1.2e88 < t Initial program 97.8%
Taylor expanded in t around inf
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--.f6481.4
Applied rewrites81.4%
(FPCore (x y z t) :precision binary64 (if (<= t 1.75e+107) (/ (* y x) z) (* (* (- -1.0 z) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.75e+107) {
tmp = (y * x) / z;
} else {
tmp = ((-1.0 - z) * 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 (t <= 1.75d+107) then
tmp = (y * x) / z
else
tmp = (((-1.0d0) - z) * t) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.75e+107) {
tmp = (y * x) / z;
} else {
tmp = ((-1.0 - z) * t) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.75e+107: tmp = (y * x) / z else: tmp = ((-1.0 - z) * t) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.75e+107) tmp = Float64(Float64(y * x) / z); else tmp = Float64(Float64(Float64(-1.0 - z) * t) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.75e+107) tmp = (y * x) / z; else tmp = ((-1.0 - z) * t) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.75e+107], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(-1.0 - z), $MachinePrecision] * t), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.75 \cdot 10^{+107}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-1 - z\right) \cdot t\right) \cdot x\\
\end{array}
\end{array}
if t < 1.7499999999999999e107Initial program 94.5%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6467.0
Applied rewrites67.0%
if 1.7499999999999999e107 < t Initial program 97.6%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6464.6
Applied rewrites64.6%
Taylor expanded in t around inf
Applied rewrites55.4%
Final simplification65.1%
(FPCore (x y z t) :precision binary64 (if (<= t 1.3e+107) (* (/ x z) y) (* (* (- -1.0 z) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.3e+107) {
tmp = (x / z) * y;
} else {
tmp = ((-1.0 - z) * 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 (t <= 1.3d+107) then
tmp = (x / z) * y
else
tmp = (((-1.0d0) - z) * t) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.3e+107) {
tmp = (x / z) * y;
} else {
tmp = ((-1.0 - z) * t) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.3e+107: tmp = (x / z) * y else: tmp = ((-1.0 - z) * t) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.3e+107) tmp = Float64(Float64(x / z) * y); else tmp = Float64(Float64(Float64(-1.0 - z) * t) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.3e+107) tmp = (x / z) * y; else tmp = ((-1.0 - z) * t) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.3e+107], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(-1.0 - z), $MachinePrecision] * t), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.3 \cdot 10^{+107}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-1 - z\right) \cdot t\right) \cdot x\\
\end{array}
\end{array}
if t < 1.3000000000000001e107Initial program 94.5%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6467.0
Applied rewrites67.0%
Applied rewrites65.0%
if 1.3000000000000001e107 < t Initial program 97.6%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6464.6
Applied rewrites64.6%
Taylor expanded in t around inf
Applied rewrites55.4%
Final simplification63.5%
(FPCore (x y z t) :precision binary64 (if (<= z 75.0) (* (* (- -1.0 z) t) x) (* (* (- x) t) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 75.0) {
tmp = ((-1.0 - z) * t) * x;
} 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 (z <= 75.0d0) then
tmp = (((-1.0d0) - z) * t) * x
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 (z <= 75.0) {
tmp = ((-1.0 - z) * t) * x;
} else {
tmp = (-x * t) * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 75.0: tmp = ((-1.0 - z) * t) * x else: tmp = (-x * t) * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 75.0) tmp = Float64(Float64(Float64(-1.0 - z) * t) * x); else tmp = Float64(Float64(Float64(-x) * t) * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 75.0) tmp = ((-1.0 - z) * t) * x; else tmp = (-x * t) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 75.0], N[(N[(N[(-1.0 - z), $MachinePrecision] * t), $MachinePrecision] * x), $MachinePrecision], N[(N[((-x) * t), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 75:\\
\;\;\;\;\left(\left(-1 - z\right) \cdot t\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-x\right) \cdot t\right) \cdot z\\
\end{array}
\end{array}
if z < 75Initial program 94.8%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6471.8
Applied rewrites71.8%
Taylor expanded in t around inf
Applied rewrites27.9%
if 75 < z Initial program 95.6%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6414.6
Applied rewrites14.6%
Taylor expanded in z around inf
Applied rewrites6.5%
Applied rewrites14.5%
Final simplification24.1%
(FPCore (x y z t) :precision binary64 (* (* (- x) t) z))
double code(double x, double y, double z, double t) {
return (-x * t) * 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 * t) * z
end function
public static double code(double x, double y, double z, double t) {
return (-x * t) * z;
}
def code(x, y, z, t): return (-x * t) * z
function code(x, y, z, t) return Float64(Float64(Float64(-x) * t) * z) end
function tmp = code(x, y, z, t) tmp = (-x * t) * z; end
code[x_, y_, z_, t_] := N[(N[((-x) * t), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-x\right) \cdot t\right) \cdot z
\end{array}
Initial program 95.0%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6456.0
Applied rewrites56.0%
Taylor expanded in z around inf
Applied rewrites6.6%
Applied rewrites10.6%
(FPCore (x y z t) :precision binary64 (* (* (- z) t) x))
double code(double x, double y, double z, double t) {
return (-z * 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 = (-z * t) * x
end function
public static double code(double x, double y, double z, double t) {
return (-z * t) * x;
}
def code(x, y, z, t): return (-z * t) * x
function code(x, y, z, t) return Float64(Float64(Float64(-z) * t) * x) end
function tmp = code(x, y, z, t) tmp = (-z * t) * x; end
code[x_, y_, z_, t_] := N[(N[((-z) * t), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-z\right) \cdot t\right) \cdot x
\end{array}
Initial program 95.0%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6456.0
Applied rewrites56.0%
Taylor expanded in z around inf
Applied rewrites6.6%
Applied rewrites6.6%
Final simplification6.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))))
(t_2 (* x (- (/ y z) (/ t (- 1.0 z))))))
(if (< t_2 -7.623226303312042e-196)
t_1
(if (< t_2 1.4133944927702302e-211)
(+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z))))
t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y / z) - (t * (1.0d0 / (1.0d0 - z))))
t_2 = x * ((y / z) - (t / (1.0d0 - z)))
if (t_2 < (-7.623226303312042d-196)) then
tmp = t_1
else if (t_2 < 1.4133944927702302d-211) then
tmp = ((y * x) / z) + -((t * x) / (1.0d0 - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))) t_2 = x * ((y / z) - (t / (1.0 - z))) tmp = 0 if t_2 < -7.623226303312042e-196: tmp = t_1 elif t_2 < 1.4133944927702302e-211: tmp = ((y * x) / z) + -((t * x) / (1.0 - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - Float64(t * Float64(1.0 / Float64(1.0 - z))))) t_2 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) tmp = 0.0 if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = Float64(Float64(Float64(y * x) / z) + Float64(-Float64(Float64(t * x) / Float64(1.0 - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))); t_2 = x * ((y / z) - (t / (1.0 - z))); tmp = 0.0; if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = ((y * x) / z) + -((t * x) / (1.0 - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t * N[(1.0 / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -7.623226303312042e-196], t$95$1, If[Less[t$95$2, 1.4133944927702302e-211], N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] + (-N[(N[(t * x), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\
t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathbf{if}\;t\_2 < -7.623226303312042 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4133944927702302 \cdot 10^{-211}:\\
\;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024254
(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)))))