
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (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 * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\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 z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (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 * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - 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) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
Initial program 87.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6497.1
Applied rewrites97.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x (- y z)) (- t z))))
(if (<= t_1 -1e-40)
(* (/ y (- t z)) x)
(if (<= t_1 -5e-294)
(/ (* (- y z) x) t)
(if (<= t_1 1e-108) (* (/ z (- z t)) x) (fma (/ y (- z)) x x))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if (t_1 <= -1e-40) {
tmp = (y / (t - z)) * x;
} else if (t_1 <= -5e-294) {
tmp = ((y - z) * x) / t;
} else if (t_1 <= 1e-108) {
tmp = (z / (z - t)) * x;
} else {
tmp = fma((y / -z), x, x);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y - z)) / Float64(t - z)) tmp = 0.0 if (t_1 <= -1e-40) tmp = Float64(Float64(y / Float64(t - z)) * x); elseif (t_1 <= -5e-294) tmp = Float64(Float64(Float64(y - z) * x) / t); elseif (t_1 <= 1e-108) tmp = Float64(Float64(z / Float64(z - t)) * x); else tmp = fma(Float64(y / Float64(-z)), x, x); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-40], N[(N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, -5e-294], N[(N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 1e-108], N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(y / (-z)), $MachinePrecision] * x + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-40}:\\
\;\;\;\;\frac{y}{t - z} \cdot x\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-294}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\
\mathbf{elif}\;t\_1 \leq 10^{-108}:\\
\;\;\;\;\frac{z}{z - t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-z}, x, x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -9.9999999999999993e-41Initial program 82.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6497.5
Applied rewrites97.5%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6497.5
Applied rewrites97.5%
Taylor expanded in y around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f64N/A
lower--.f6463.8
Applied rewrites63.8%
Applied rewrites63.8%
if -9.9999999999999993e-41 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -5.0000000000000003e-294Initial program 95.5%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6448.1
Applied rewrites48.1%
if -5.0000000000000003e-294 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.00000000000000004e-108Initial program 90.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6496.4
Applied rewrites96.4%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6496.3
Applied rewrites96.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6475.2
Applied rewrites75.2%
if 1.00000000000000004e-108 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 85.2%
Taylor expanded in t around 0
mul-1-negN/A
neg-sub0N/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-/l*N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
neg-sub0N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites60.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x (- y z)) (- t z))))
(if (<= t_1 -1e-40)
(* (/ y (- t z)) x)
(if (<= t_1 1e-286)
(/ (* (- y z) x) t)
(if (<= t_1 1e-108) (/ (* z x) (- z t)) (fma (/ y (- z)) x x))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if (t_1 <= -1e-40) {
tmp = (y / (t - z)) * x;
} else if (t_1 <= 1e-286) {
tmp = ((y - z) * x) / t;
} else if (t_1 <= 1e-108) {
tmp = (z * x) / (z - t);
} else {
tmp = fma((y / -z), x, x);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y - z)) / Float64(t - z)) tmp = 0.0 if (t_1 <= -1e-40) tmp = Float64(Float64(y / Float64(t - z)) * x); elseif (t_1 <= 1e-286) tmp = Float64(Float64(Float64(y - z) * x) / t); elseif (t_1 <= 1e-108) tmp = Float64(Float64(z * x) / Float64(z - t)); else tmp = fma(Float64(y / Float64(-z)), x, x); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-40], N[(N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 1e-286], N[(N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 1e-108], N[(N[(z * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(y / (-z)), $MachinePrecision] * x + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-40}:\\
\;\;\;\;\frac{y}{t - z} \cdot x\\
\mathbf{elif}\;t\_1 \leq 10^{-286}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\
\mathbf{elif}\;t\_1 \leq 10^{-108}:\\
\;\;\;\;\frac{z \cdot x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-z}, x, x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -9.9999999999999993e-41Initial program 82.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6497.5
Applied rewrites97.5%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6497.5
Applied rewrites97.5%
Taylor expanded in y around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f64N/A
lower--.f6463.8
Applied rewrites63.8%
Applied rewrites63.8%
if -9.9999999999999993e-41 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.00000000000000005e-286Initial program 90.6%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6462.0
Applied rewrites62.0%
if 1.00000000000000005e-286 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.00000000000000004e-108Initial program 99.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6496.1
Applied rewrites96.1%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6469.6
Applied rewrites69.6%
if 1.00000000000000004e-108 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 85.2%
Taylor expanded in t around 0
mul-1-negN/A
neg-sub0N/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-/l*N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
neg-sub0N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites60.8%
Final simplification63.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x (- y z)) (- t z))))
(if (<= t_1 -1e-40)
(* (/ x (- t z)) y)
(if (<= t_1 1e-286)
(/ (* (- y z) x) t)
(if (<= t_1 1e-108) (/ (* z x) (- z t)) (fma (/ y (- z)) x x))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if (t_1 <= -1e-40) {
tmp = (x / (t - z)) * y;
} else if (t_1 <= 1e-286) {
tmp = ((y - z) * x) / t;
} else if (t_1 <= 1e-108) {
tmp = (z * x) / (z - t);
} else {
tmp = fma((y / -z), x, x);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y - z)) / Float64(t - z)) tmp = 0.0 if (t_1 <= -1e-40) tmp = Float64(Float64(x / Float64(t - z)) * y); elseif (t_1 <= 1e-286) tmp = Float64(Float64(Float64(y - z) * x) / t); elseif (t_1 <= 1e-108) tmp = Float64(Float64(z * x) / Float64(z - t)); else tmp = fma(Float64(y / Float64(-z)), x, x); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-40], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 1e-286], N[(N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 1e-108], N[(N[(z * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(y / (-z)), $MachinePrecision] * x + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-40}:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\
\mathbf{elif}\;t\_1 \leq 10^{-286}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\
\mathbf{elif}\;t\_1 \leq 10^{-108}:\\
\;\;\;\;\frac{z \cdot x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-z}, x, x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -9.9999999999999993e-41Initial program 82.8%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6464.9
Applied rewrites64.9%
if -9.9999999999999993e-41 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.00000000000000005e-286Initial program 90.6%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6462.0
Applied rewrites62.0%
if 1.00000000000000005e-286 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.00000000000000004e-108Initial program 99.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6496.1
Applied rewrites96.1%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6469.6
Applied rewrites69.6%
if 1.00000000000000004e-108 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 85.2%
Taylor expanded in t around 0
mul-1-negN/A
neg-sub0N/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-/l*N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
neg-sub0N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites60.8%
Final simplification63.3%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* x (- y z)) (- t z)) 1e-286) (* x (/ y t)) (* 1.0 x)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * (y - z)) / (t - z)) <= 1e-286) {
tmp = x * (y / t);
} else {
tmp = 1.0 * 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 (((x * (y - z)) / (t - z)) <= 1d-286) then
tmp = x * (y / t)
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x * (y - z)) / (t - z)) <= 1e-286) {
tmp = x * (y / t);
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * (y - z)) / (t - z)) <= 1e-286: tmp = x * (y / t) else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * Float64(y - z)) / Float64(t - z)) <= 1e-286) tmp = Float64(x * Float64(y / t)); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x * (y - z)) / (t - z)) <= 1e-286) tmp = x * (y / t); else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], 1e-286], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 10^{-286}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.00000000000000005e-286Initial program 86.4%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6440.4
Applied rewrites40.4%
Applied rewrites41.1%
if 1.00000000000000005e-286 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 88.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6496.7
Applied rewrites96.7%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6496.0
Applied rewrites96.0%
Taylor expanded in z around inf
Applied rewrites39.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* z x) (- z t))))
(if (<= z -7.4e+213)
(* 1.0 x)
(if (<= z -1.5e-33)
t_1
(if (<= z -6.8e-142)
(/ (* (- y z) x) t)
(if (<= z 1.05e+52) (* (/ x (- t z)) y) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * x) / (z - t);
double tmp;
if (z <= -7.4e+213) {
tmp = 1.0 * x;
} else if (z <= -1.5e-33) {
tmp = t_1;
} else if (z <= -6.8e-142) {
tmp = ((y - z) * x) / t;
} else if (z <= 1.05e+52) {
tmp = (x / (t - 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 = (z * x) / (z - t)
if (z <= (-7.4d+213)) then
tmp = 1.0d0 * x
else if (z <= (-1.5d-33)) then
tmp = t_1
else if (z <= (-6.8d-142)) then
tmp = ((y - z) * x) / t
else if (z <= 1.05d+52) then
tmp = (x / (t - 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 = (z * x) / (z - t);
double tmp;
if (z <= -7.4e+213) {
tmp = 1.0 * x;
} else if (z <= -1.5e-33) {
tmp = t_1;
} else if (z <= -6.8e-142) {
tmp = ((y - z) * x) / t;
} else if (z <= 1.05e+52) {
tmp = (x / (t - z)) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * x) / (z - t) tmp = 0 if z <= -7.4e+213: tmp = 1.0 * x elif z <= -1.5e-33: tmp = t_1 elif z <= -6.8e-142: tmp = ((y - z) * x) / t elif z <= 1.05e+52: tmp = (x / (t - z)) * y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * x) / Float64(z - t)) tmp = 0.0 if (z <= -7.4e+213) tmp = Float64(1.0 * x); elseif (z <= -1.5e-33) tmp = t_1; elseif (z <= -6.8e-142) tmp = Float64(Float64(Float64(y - z) * x) / t); elseif (z <= 1.05e+52) tmp = Float64(Float64(x / Float64(t - z)) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * x) / (z - t); tmp = 0.0; if (z <= -7.4e+213) tmp = 1.0 * x; elseif (z <= -1.5e-33) tmp = t_1; elseif (z <= -6.8e-142) tmp = ((y - z) * x) / t; elseif (z <= 1.05e+52) tmp = (x / (t - z)) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.4e+213], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, -1.5e-33], t$95$1, If[LessEqual[z, -6.8e-142], N[(N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.05e+52], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot x}{z - t}\\
\mathbf{if}\;z \leq -7.4 \cdot 10^{+213}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-142}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+52}:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.39999999999999985e213Initial program 42.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites94.0%
if -7.39999999999999985e213 < z < -1.5000000000000001e-33 or 1.05e52 < z Initial program 85.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6471.3
Applied rewrites71.3%
if -1.5000000000000001e-33 < z < -6.80000000000000057e-142Initial program 99.7%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.8
Applied rewrites79.8%
if -6.80000000000000057e-142 < z < 1.05e52Initial program 92.5%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6478.5
Applied rewrites78.5%
Final simplification77.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* z x) (- z t))))
(if (<= z -7.4e+213)
(* 1.0 x)
(if (<= z -8e-40)
t_1
(if (<= z -4e-141)
(* x (/ (- y z) t))
(if (<= z 1.05e+52) (* (/ x (- t z)) y) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * x) / (z - t);
double tmp;
if (z <= -7.4e+213) {
tmp = 1.0 * x;
} else if (z <= -8e-40) {
tmp = t_1;
} else if (z <= -4e-141) {
tmp = x * ((y - z) / t);
} else if (z <= 1.05e+52) {
tmp = (x / (t - 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 = (z * x) / (z - t)
if (z <= (-7.4d+213)) then
tmp = 1.0d0 * x
else if (z <= (-8d-40)) then
tmp = t_1
else if (z <= (-4d-141)) then
tmp = x * ((y - z) / t)
else if (z <= 1.05d+52) then
tmp = (x / (t - 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 = (z * x) / (z - t);
double tmp;
if (z <= -7.4e+213) {
tmp = 1.0 * x;
} else if (z <= -8e-40) {
tmp = t_1;
} else if (z <= -4e-141) {
tmp = x * ((y - z) / t);
} else if (z <= 1.05e+52) {
tmp = (x / (t - z)) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * x) / (z - t) tmp = 0 if z <= -7.4e+213: tmp = 1.0 * x elif z <= -8e-40: tmp = t_1 elif z <= -4e-141: tmp = x * ((y - z) / t) elif z <= 1.05e+52: tmp = (x / (t - z)) * y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * x) / Float64(z - t)) tmp = 0.0 if (z <= -7.4e+213) tmp = Float64(1.0 * x); elseif (z <= -8e-40) tmp = t_1; elseif (z <= -4e-141) tmp = Float64(x * Float64(Float64(y - z) / t)); elseif (z <= 1.05e+52) tmp = Float64(Float64(x / Float64(t - z)) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * x) / (z - t); tmp = 0.0; if (z <= -7.4e+213) tmp = 1.0 * x; elseif (z <= -8e-40) tmp = t_1; elseif (z <= -4e-141) tmp = x * ((y - z) / t); elseif (z <= 1.05e+52) tmp = (x / (t - z)) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.4e+213], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, -8e-40], t$95$1, If[LessEqual[z, -4e-141], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e+52], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot x}{z - t}\\
\mathbf{if}\;z \leq -7.4 \cdot 10^{+213}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-141}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+52}:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.39999999999999985e213Initial program 42.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites94.0%
if -7.39999999999999985e213 < z < -7.9999999999999994e-40 or 1.05e52 < z Initial program 85.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6469.7
Applied rewrites69.7%
if -7.9999999999999994e-40 < z < -4.0000000000000002e-141Initial program 99.7%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6486.3
Applied rewrites86.3%
Applied rewrites86.2%
if -4.0000000000000002e-141 < z < 1.05e52Initial program 92.5%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6478.5
Applied rewrites78.5%
Final simplification77.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* z x) (- z t))))
(if (<= z -7.4e+213)
(* 1.0 x)
(if (<= z -4.8e-60)
t_1
(if (<= z 2.2e-131)
(/ (* y x) t)
(if (<= z 0.000102) (* (- y) (/ x z)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * x) / (z - t);
double tmp;
if (z <= -7.4e+213) {
tmp = 1.0 * x;
} else if (z <= -4.8e-60) {
tmp = t_1;
} else if (z <= 2.2e-131) {
tmp = (y * x) / t;
} else if (z <= 0.000102) {
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 = (z * x) / (z - t)
if (z <= (-7.4d+213)) then
tmp = 1.0d0 * x
else if (z <= (-4.8d-60)) then
tmp = t_1
else if (z <= 2.2d-131) then
tmp = (y * x) / t
else if (z <= 0.000102d0) 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 = (z * x) / (z - t);
double tmp;
if (z <= -7.4e+213) {
tmp = 1.0 * x;
} else if (z <= -4.8e-60) {
tmp = t_1;
} else if (z <= 2.2e-131) {
tmp = (y * x) / t;
} else if (z <= 0.000102) {
tmp = -y * (x / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * x) / (z - t) tmp = 0 if z <= -7.4e+213: tmp = 1.0 * x elif z <= -4.8e-60: tmp = t_1 elif z <= 2.2e-131: tmp = (y * x) / t elif z <= 0.000102: tmp = -y * (x / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * x) / Float64(z - t)) tmp = 0.0 if (z <= -7.4e+213) tmp = Float64(1.0 * x); elseif (z <= -4.8e-60) tmp = t_1; elseif (z <= 2.2e-131) tmp = Float64(Float64(y * x) / t); elseif (z <= 0.000102) tmp = Float64(Float64(-y) * Float64(x / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * x) / (z - t); tmp = 0.0; if (z <= -7.4e+213) tmp = 1.0 * x; elseif (z <= -4.8e-60) tmp = t_1; elseif (z <= 2.2e-131) tmp = (y * x) / t; elseif (z <= 0.000102) tmp = -y * (x / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.4e+213], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, -4.8e-60], t$95$1, If[LessEqual[z, 2.2e-131], N[(N[(y * x), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 0.000102], N[((-y) * N[(x / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot x}{z - t}\\
\mathbf{if}\;z \leq -7.4 \cdot 10^{+213}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-131}:\\
\;\;\;\;\frac{y \cdot x}{t}\\
\mathbf{elif}\;z \leq 0.000102:\\
\;\;\;\;\left(-y\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.39999999999999985e213Initial program 42.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites94.0%
if -7.39999999999999985e213 < z < -4.80000000000000019e-60 or 1.01999999999999999e-4 < z Initial program 87.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6467.1
Applied rewrites67.1%
if -4.80000000000000019e-60 < z < 2.2e-131Initial program 92.9%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6468.9
Applied rewrites68.9%
if 2.2e-131 < z < 1.01999999999999999e-4Initial program 97.1%
Taylor expanded in t around 0
mul-1-negN/A
neg-sub0N/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-/l*N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
neg-sub0N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites59.6%
Taylor expanded in y around inf
Applied rewrites59.6%
Final simplification68.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -7.4e+213)
(* 1.0 x)
(if (or (<= z -8e-40) (not (<= z 2.35e+24)))
(/ (* z x) (- z t))
(* x (/ (- y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.4e+213) {
tmp = 1.0 * x;
} else if ((z <= -8e-40) || !(z <= 2.35e+24)) {
tmp = (z * x) / (z - t);
} 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 <= (-7.4d+213)) then
tmp = 1.0d0 * x
else if ((z <= (-8d-40)) .or. (.not. (z <= 2.35d+24))) then
tmp = (z * x) / (z - t)
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 <= -7.4e+213) {
tmp = 1.0 * x;
} else if ((z <= -8e-40) || !(z <= 2.35e+24)) {
tmp = (z * x) / (z - t);
} else {
tmp = x * ((y - z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.4e+213: tmp = 1.0 * x elif (z <= -8e-40) or not (z <= 2.35e+24): tmp = (z * x) / (z - t) else: tmp = x * ((y - z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.4e+213) tmp = Float64(1.0 * x); elseif ((z <= -8e-40) || !(z <= 2.35e+24)) tmp = Float64(Float64(z * x) / Float64(z - t)); 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 <= -7.4e+213) tmp = 1.0 * x; elseif ((z <= -8e-40) || ~((z <= 2.35e+24))) tmp = (z * x) / (z - t); else tmp = x * ((y - z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.4e+213], N[(1.0 * x), $MachinePrecision], If[Or[LessEqual[z, -8e-40], N[Not[LessEqual[z, 2.35e+24]], $MachinePrecision]], N[(N[(z * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{+213}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-40} \lor \neg \left(z \leq 2.35 \cdot 10^{+24}\right):\\
\;\;\;\;\frac{z \cdot x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\end{array}
\end{array}
if z < -7.39999999999999985e213Initial program 42.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites94.0%
if -7.39999999999999985e213 < z < -7.9999999999999994e-40 or 2.35e24 < z Initial program 86.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6468.6
Applied rewrites68.6%
if -7.9999999999999994e-40 < z < 2.35e24Initial program 93.7%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6470.3
Applied rewrites70.3%
Applied rewrites68.3%
Final simplification70.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.5e-33)
(* 1.0 x)
(if (<= z 2.2e-131)
(/ (* y x) t)
(if (<= z 1.8e+24) (* (- y) (/ x z)) (* 1.0 x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e-33) {
tmp = 1.0 * x;
} else if (z <= 2.2e-131) {
tmp = (y * x) / t;
} else if (z <= 1.8e+24) {
tmp = -y * (x / z);
} else {
tmp = 1.0 * 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.5d-33)) then
tmp = 1.0d0 * x
else if (z <= 2.2d-131) then
tmp = (y * x) / t
else if (z <= 1.8d+24) then
tmp = -y * (x / z)
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e-33) {
tmp = 1.0 * x;
} else if (z <= 2.2e-131) {
tmp = (y * x) / t;
} else if (z <= 1.8e+24) {
tmp = -y * (x / z);
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.5e-33: tmp = 1.0 * x elif z <= 2.2e-131: tmp = (y * x) / t elif z <= 1.8e+24: tmp = -y * (x / z) else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.5e-33) tmp = Float64(1.0 * x); elseif (z <= 2.2e-131) tmp = Float64(Float64(y * x) / t); elseif (z <= 1.8e+24) tmp = Float64(Float64(-y) * Float64(x / z)); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.5e-33) tmp = 1.0 * x; elseif (z <= 2.2e-131) tmp = (y * x) / t; elseif (z <= 1.8e+24) tmp = -y * (x / z); else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.5e-33], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 2.2e-131], N[(N[(y * x), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.8e+24], N[((-y) * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-33}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-131}:\\
\;\;\;\;\frac{y \cdot x}{t}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+24}:\\
\;\;\;\;\left(-y\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -1.5000000000000001e-33 or 1.79999999999999992e24 < z Initial program 79.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites61.5%
if -1.5000000000000001e-33 < z < 2.2e-131Initial program 93.5%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6466.2
Applied rewrites66.2%
if 2.2e-131 < z < 1.79999999999999992e24Initial program 95.0%
Taylor expanded in t around 0
mul-1-negN/A
neg-sub0N/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-/l*N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
neg-sub0N/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites60.5%
Taylor expanded in y around inf
Applied rewrites55.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.35e+136) (not (<= z 4.9e+182))) (* (/ z (- z t)) x) (* (/ x (- t z)) (- y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.35e+136) || !(z <= 4.9e+182)) {
tmp = (z / (z - t)) * x;
} else {
tmp = (x / (t - z)) * (y - z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-4.35d+136)) .or. (.not. (z <= 4.9d+182))) then
tmp = (z / (z - t)) * x
else
tmp = (x / (t - z)) * (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.35e+136) || !(z <= 4.9e+182)) {
tmp = (z / (z - t)) * x;
} else {
tmp = (x / (t - z)) * (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.35e+136) or not (z <= 4.9e+182): tmp = (z / (z - t)) * x else: tmp = (x / (t - z)) * (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.35e+136) || !(z <= 4.9e+182)) tmp = Float64(Float64(z / Float64(z - t)) * x); else tmp = Float64(Float64(x / Float64(t - z)) * Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.35e+136) || ~((z <= 4.9e+182))) tmp = (z / (z - t)) * x; else tmp = (x / (t - z)) * (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.35e+136], N[Not[LessEqual[z, 4.9e+182]], $MachinePrecision]], N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.35 \cdot 10^{+136} \lor \neg \left(z \leq 4.9 \cdot 10^{+182}\right):\\
\;\;\;\;\frac{z}{z - t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\
\end{array}
\end{array}
if z < -4.34999999999999987e136 or 4.9e182 < z Initial program 71.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6495.3
Applied rewrites95.3%
if -4.34999999999999987e136 < z < 4.9e182Initial program 92.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6494.8
Applied rewrites94.8%
Final simplification94.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.5e-33) (not (<= z 5.2e+70))) (* 1.0 x) (/ (* y x) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.5e-33) || !(z <= 5.2e+70)) {
tmp = 1.0 * x;
} else {
tmp = (y * x) / 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.5d-33)) .or. (.not. (z <= 5.2d+70))) then
tmp = 1.0d0 * x
else
tmp = (y * x) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.5e-33) || !(z <= 5.2e+70)) {
tmp = 1.0 * x;
} else {
tmp = (y * x) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.5e-33) or not (z <= 5.2e+70): tmp = 1.0 * x else: tmp = (y * x) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.5e-33) || !(z <= 5.2e+70)) tmp = Float64(1.0 * x); else tmp = Float64(Float64(y * x) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.5e-33) || ~((z <= 5.2e+70))) tmp = 1.0 * x; else tmp = (y * x) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.5e-33], N[Not[LessEqual[z, 5.2e+70]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-33} \lor \neg \left(z \leq 5.2 \cdot 10^{+70}\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{t}\\
\end{array}
\end{array}
if z < -1.5000000000000001e-33 or 5.2000000000000001e70 < z Initial program 77.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites63.7%
if -1.5000000000000001e-33 < z < 5.2000000000000001e70Initial program 94.3%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6456.4
Applied rewrites56.4%
Final simplification59.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.05e-39) (not (<= z 5.2e+70))) (* 1.0 x) (* (/ x t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-39) || !(z <= 5.2e+70)) {
tmp = 1.0 * x;
} else {
tmp = (x / t) * 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 ((z <= (-1.05d-39)) .or. (.not. (z <= 5.2d+70))) then
tmp = 1.0d0 * x
else
tmp = (x / t) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-39) || !(z <= 5.2e+70)) {
tmp = 1.0 * x;
} else {
tmp = (x / t) * y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.05e-39) or not (z <= 5.2e+70): tmp = 1.0 * x else: tmp = (x / t) * y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.05e-39) || !(z <= 5.2e+70)) tmp = Float64(1.0 * x); else tmp = Float64(Float64(x / t) * y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.05e-39) || ~((z <= 5.2e+70))) tmp = 1.0 * x; else tmp = (x / t) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.05e-39], N[Not[LessEqual[z, 5.2e+70]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-39} \lor \neg \left(z \leq 5.2 \cdot 10^{+70}\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\end{array}
\end{array}
if z < -1.04999999999999997e-39 or 5.2000000000000001e70 < z Initial program 78.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites62.7%
if -1.04999999999999997e-39 < z < 5.2000000000000001e70Initial program 94.1%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6456.9
Applied rewrites56.9%
Applied rewrites56.9%
Final simplification59.4%
(FPCore (x y z t) :precision binary64 (* (/ (- y z) (- t z)) x))
double code(double x, double y, double z, double t) {
return ((y - z) / (t - 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 - z)) * x
end function
public static double code(double x, double y, double z, double t) {
return ((y - z) / (t - z)) * x;
}
def code(x, y, z, t): return ((y - z) / (t - z)) * x
function code(x, y, z, t) return Float64(Float64(Float64(y - z) / Float64(t - z)) * x) end
function tmp = code(x, y, z, t) tmp = ((y - z) / (t - z)) * x; end
code[x_, y_, z_, t_] := N[(N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\frac{y - z}{t - z} \cdot x
\end{array}
Initial program 87.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6496.8
Applied rewrites96.8%
(FPCore (x y z t) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t) {
return 1.0 * 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t) {
return 1.0 * x;
}
def code(x, y, z, t): return 1.0 * x
function code(x, y, z, t) return Float64(1.0 * x) end
function tmp = code(x, y, z, t) tmp = 1.0 * x; end
code[x_, y_, z_, t_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 87.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6497.1
Applied rewrites97.1%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6496.8
Applied rewrites96.8%
Taylor expanded in z around inf
Applied rewrites33.9%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - 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) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2024296
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (/ x (/ (- t z) (- y z))))
(/ (* x (- y z)) (- t z)))