
(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 11 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 (* (/ (- 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 83.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6496.0
Applied rewrites96.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x z) (- z y))))
(if (<= z -4.6e+134)
(* 1.0 x)
(if (<= z -1.85e-33)
(* (/ (- y z) t) x)
(if (<= z -1.02e-60)
t_1
(if (<= z 2.5e-40)
(* (/ x t) (- y z))
(if (<= z 1.4e+138) t_1 (* 1.0 x))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / z) * (z - y);
double tmp;
if (z <= -4.6e+134) {
tmp = 1.0 * x;
} else if (z <= -1.85e-33) {
tmp = ((y - z) / t) * x;
} else if (z <= -1.02e-60) {
tmp = t_1;
} else if (z <= 2.5e-40) {
tmp = (x / t) * (y - z);
} else if (z <= 1.4e+138) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / z) * (z - y)
if (z <= (-4.6d+134)) then
tmp = 1.0d0 * x
else if (z <= (-1.85d-33)) then
tmp = ((y - z) / t) * x
else if (z <= (-1.02d-60)) then
tmp = t_1
else if (z <= 2.5d-40) then
tmp = (x / t) * (y - z)
else if (z <= 1.4d+138) then
tmp = t_1
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) * (z - y);
double tmp;
if (z <= -4.6e+134) {
tmp = 1.0 * x;
} else if (z <= -1.85e-33) {
tmp = ((y - z) / t) * x;
} else if (z <= -1.02e-60) {
tmp = t_1;
} else if (z <= 2.5e-40) {
tmp = (x / t) * (y - z);
} else if (z <= 1.4e+138) {
tmp = t_1;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) * (z - y) tmp = 0 if z <= -4.6e+134: tmp = 1.0 * x elif z <= -1.85e-33: tmp = ((y - z) / t) * x elif z <= -1.02e-60: tmp = t_1 elif z <= 2.5e-40: tmp = (x / t) * (y - z) elif z <= 1.4e+138: tmp = t_1 else: tmp = 1.0 * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) * Float64(z - y)) tmp = 0.0 if (z <= -4.6e+134) tmp = Float64(1.0 * x); elseif (z <= -1.85e-33) tmp = Float64(Float64(Float64(y - z) / t) * x); elseif (z <= -1.02e-60) tmp = t_1; elseif (z <= 2.5e-40) tmp = Float64(Float64(x / t) * Float64(y - z)); elseif (z <= 1.4e+138) tmp = t_1; else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) * (z - y); tmp = 0.0; if (z <= -4.6e+134) tmp = 1.0 * x; elseif (z <= -1.85e-33) tmp = ((y - z) / t) * x; elseif (z <= -1.02e-60) tmp = t_1; elseif (z <= 2.5e-40) tmp = (x / t) * (y - z); elseif (z <= 1.4e+138) tmp = t_1; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+134], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, -1.85e-33], N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, -1.02e-60], t$95$1, If[LessEqual[z, 2.5e-40], N[(N[(x / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+138], t$95$1, N[(1.0 * x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot \left(z - y\right)\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+134}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-33}:\\
\;\;\;\;\frac{y - z}{t} \cdot x\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-40}:\\
\;\;\;\;\frac{x}{t} \cdot \left(y - z\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -4.5999999999999996e134 or 1.4e138 < z Initial program 66.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites72.1%
if -4.5999999999999996e134 < z < -1.85000000000000007e-33Initial program 96.6%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6462.3
Applied rewrites62.3%
Taylor expanded in y around 0
Applied rewrites32.0%
Taylor expanded in y around 0
Applied rewrites62.3%
if -1.85000000000000007e-33 < z < -1.01999999999999994e-60 or 2.49999999999999982e-40 < z < 1.4e138Initial program 91.0%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6470.0
Applied rewrites70.0%
Applied rewrites66.2%
if -1.01999999999999994e-60 < z < 2.49999999999999982e-40Initial program 90.5%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6481.9
Applied rewrites81.9%
Applied rewrites85.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ z (- t z)) (- x))))
(if (<= z -8e-65)
t_1
(if (<= z 1.75e-40)
(* (/ x t) (- y z))
(if (<= z 3.8e+57) (* (/ (- z y) z) x) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (z / (t - z)) * -x;
double tmp;
if (z <= -8e-65) {
tmp = t_1;
} else if (z <= 1.75e-40) {
tmp = (x / t) * (y - z);
} else if (z <= 3.8e+57) {
tmp = ((z - 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 = (z / (t - z)) * -x
if (z <= (-8d-65)) then
tmp = t_1
else if (z <= 1.75d-40) then
tmp = (x / t) * (y - z)
else if (z <= 3.8d+57) then
tmp = ((z - 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 = (z / (t - z)) * -x;
double tmp;
if (z <= -8e-65) {
tmp = t_1;
} else if (z <= 1.75e-40) {
tmp = (x / t) * (y - z);
} else if (z <= 3.8e+57) {
tmp = ((z - y) / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / (t - z)) * -x tmp = 0 if z <= -8e-65: tmp = t_1 elif z <= 1.75e-40: tmp = (x / t) * (y - z) elif z <= 3.8e+57: tmp = ((z - y) / z) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / Float64(t - z)) * Float64(-x)) tmp = 0.0 if (z <= -8e-65) tmp = t_1; elseif (z <= 1.75e-40) tmp = Float64(Float64(x / t) * Float64(y - z)); elseif (z <= 3.8e+57) tmp = Float64(Float64(Float64(z - y) / z) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / (t - z)) * -x; tmp = 0.0; if (z <= -8e-65) tmp = t_1; elseif (z <= 1.75e-40) tmp = (x / t) * (y - z); elseif (z <= 3.8e+57) tmp = ((z - y) / z) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision]}, If[LessEqual[z, -8e-65], t$95$1, If[LessEqual[z, 1.75e-40], N[(N[(x / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+57], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{t - z} \cdot \left(-x\right)\\
\mathbf{if}\;z \leq -8 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-40}:\\
\;\;\;\;\frac{x}{t} \cdot \left(y - z\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+57}:\\
\;\;\;\;\frac{z - y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.99999999999999939e-65 or 3.7999999999999999e57 < z Initial program 77.6%
Taylor expanded in y around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6478.4
Applied rewrites78.4%
if -7.99999999999999939e-65 < z < 1.7500000000000001e-40Initial program 90.4%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6481.7
Applied rewrites81.7%
Applied rewrites85.6%
if 1.7500000000000001e-40 < z < 3.7999999999999999e57Initial program 91.0%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6473.7
Applied rewrites73.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.9e+67)
(* 1.0 x)
(if (<= z 4.6e+39)
(* (/ x t) (- y z))
(if (<= z 6e+75) (* (/ (- y) z) x) (* 1.0 x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.9e+67) {
tmp = 1.0 * x;
} else if (z <= 4.6e+39) {
tmp = (x / t) * (y - z);
} else if (z <= 6e+75) {
tmp = (-y / z) * x;
} 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 <= (-2.9d+67)) then
tmp = 1.0d0 * x
else if (z <= 4.6d+39) then
tmp = (x / t) * (y - z)
else if (z <= 6d+75) then
tmp = (-y / z) * x
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 <= -2.9e+67) {
tmp = 1.0 * x;
} else if (z <= 4.6e+39) {
tmp = (x / t) * (y - z);
} else if (z <= 6e+75) {
tmp = (-y / z) * x;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.9e+67: tmp = 1.0 * x elif z <= 4.6e+39: tmp = (x / t) * (y - z) elif z <= 6e+75: tmp = (-y / z) * x else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.9e+67) tmp = Float64(1.0 * x); elseif (z <= 4.6e+39) tmp = Float64(Float64(x / t) * Float64(y - z)); elseif (z <= 6e+75) tmp = Float64(Float64(Float64(-y) / z) * x); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.9e+67) tmp = 1.0 * x; elseif (z <= 4.6e+39) tmp = (x / t) * (y - z); elseif (z <= 6e+75) tmp = (-y / z) * x; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.9e+67], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 4.6e+39], N[(N[(x / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+75], N[(N[((-y) / z), $MachinePrecision] * x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+67}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+39}:\\
\;\;\;\;\frac{x}{t} \cdot \left(y - z\right)\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+75}:\\
\;\;\;\;\frac{-y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -2.90000000000000023e67 or 6e75 < z Initial program 71.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites67.6%
if -2.90000000000000023e67 < z < 4.60000000000000024e39Initial program 91.2%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6472.8
Applied rewrites72.8%
Applied rewrites74.3%
if 4.60000000000000024e39 < z < 6e75Initial program 92.1%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6464.1
Applied rewrites64.1%
Taylor expanded in y around inf
Applied rewrites68.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.6e+134)
(* 1.0 x)
(if (<= z 4.6e+39)
(* (/ (- y z) t) x)
(if (<= z 6e+75) (* (/ (- y) z) x) (* 1.0 x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.6e+134) {
tmp = 1.0 * x;
} else if (z <= 4.6e+39) {
tmp = ((y - z) / t) * x;
} else if (z <= 6e+75) {
tmp = (-y / z) * x;
} 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 <= (-4.6d+134)) then
tmp = 1.0d0 * x
else if (z <= 4.6d+39) then
tmp = ((y - z) / t) * x
else if (z <= 6d+75) then
tmp = (-y / z) * x
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 <= -4.6e+134) {
tmp = 1.0 * x;
} else if (z <= 4.6e+39) {
tmp = ((y - z) / t) * x;
} else if (z <= 6e+75) {
tmp = (-y / z) * x;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.6e+134: tmp = 1.0 * x elif z <= 4.6e+39: tmp = ((y - z) / t) * x elif z <= 6e+75: tmp = (-y / z) * x else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.6e+134) tmp = Float64(1.0 * x); elseif (z <= 4.6e+39) tmp = Float64(Float64(Float64(y - z) / t) * x); elseif (z <= 6e+75) tmp = Float64(Float64(Float64(-y) / z) * x); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.6e+134) tmp = 1.0 * x; elseif (z <= 4.6e+39) tmp = ((y - z) / t) * x; elseif (z <= 6e+75) tmp = (-y / z) * x; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.6e+134], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 4.6e+39], N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 6e+75], N[(N[((-y) / z), $MachinePrecision] * x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+134}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+39}:\\
\;\;\;\;\frac{y - z}{t} \cdot x\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+75}:\\
\;\;\;\;\frac{-y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -4.5999999999999996e134 or 6e75 < z Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites70.0%
if -4.5999999999999996e134 < z < 4.60000000000000024e39Initial program 91.7%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6471.7
Applied rewrites71.7%
Taylor expanded in y around 0
Applied rewrites25.0%
Taylor expanded in y around 0
Applied rewrites71.7%
if 4.60000000000000024e39 < z < 6e75Initial program 92.1%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6464.1
Applied rewrites64.1%
Taylor expanded in y around inf
Applied rewrites68.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -8.5e-65)
(* 1.0 x)
(if (<= z 4.5e-19)
(* (/ x t) y)
(if (<= z 6e+75) (* (/ (- y) z) x) (* 1.0 x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.5e-65) {
tmp = 1.0 * x;
} else if (z <= 4.5e-19) {
tmp = (x / t) * y;
} else if (z <= 6e+75) {
tmp = (-y / z) * x;
} 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 <= (-8.5d-65)) then
tmp = 1.0d0 * x
else if (z <= 4.5d-19) then
tmp = (x / t) * y
else if (z <= 6d+75) then
tmp = (-y / z) * x
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 <= -8.5e-65) {
tmp = 1.0 * x;
} else if (z <= 4.5e-19) {
tmp = (x / t) * y;
} else if (z <= 6e+75) {
tmp = (-y / z) * x;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.5e-65: tmp = 1.0 * x elif z <= 4.5e-19: tmp = (x / t) * y elif z <= 6e+75: tmp = (-y / z) * x else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.5e-65) tmp = Float64(1.0 * x); elseif (z <= 4.5e-19) tmp = Float64(Float64(x / t) * y); elseif (z <= 6e+75) tmp = Float64(Float64(Float64(-y) / z) * x); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8.5e-65) tmp = 1.0 * x; elseif (z <= 4.5e-19) tmp = (x / t) * y; elseif (z <= 6e+75) tmp = (-y / z) * x; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.5e-65], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 4.5e-19], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 6e+75], N[(N[((-y) / z), $MachinePrecision] * x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-65}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+75}:\\
\;\;\;\;\frac{-y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -8.5000000000000003e-65 or 6e75 < z Initial program 77.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.1
Applied rewrites99.1%
Taylor expanded in z around inf
Applied rewrites60.6%
if -8.5000000000000003e-65 < z < 4.50000000000000013e-19Initial program 90.0%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6466.9
Applied rewrites66.9%
Applied rewrites70.7%
if 4.50000000000000013e-19 < z < 6e75Initial program 90.8%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6461.3
Applied rewrites61.3%
Taylor expanded in y around inf
Applied rewrites54.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -8.5e-65)
(* 1.0 x)
(if (<= z 4.5e-19)
(* (/ x t) y)
(if (<= z 5.8e+75) (* (- y) (/ x z)) (* 1.0 x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.5e-65) {
tmp = 1.0 * x;
} else if (z <= 4.5e-19) {
tmp = (x / t) * y;
} else if (z <= 5.8e+75) {
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 <= (-8.5d-65)) then
tmp = 1.0d0 * x
else if (z <= 4.5d-19) then
tmp = (x / t) * y
else if (z <= 5.8d+75) 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 <= -8.5e-65) {
tmp = 1.0 * x;
} else if (z <= 4.5e-19) {
tmp = (x / t) * y;
} else if (z <= 5.8e+75) {
tmp = -y * (x / z);
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.5e-65: tmp = 1.0 * x elif z <= 4.5e-19: tmp = (x / t) * y elif z <= 5.8e+75: tmp = -y * (x / z) else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.5e-65) tmp = Float64(1.0 * x); elseif (z <= 4.5e-19) tmp = Float64(Float64(x / t) * y); elseif (z <= 5.8e+75) 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 <= -8.5e-65) tmp = 1.0 * x; elseif (z <= 4.5e-19) tmp = (x / t) * y; elseif (z <= 5.8e+75) tmp = -y * (x / z); else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.5e-65], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 4.5e-19], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 5.8e+75], N[((-y) * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-65}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+75}:\\
\;\;\;\;\left(-y\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -8.5000000000000003e-65 or 5.7999999999999997e75 < z Initial program 77.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.1
Applied rewrites99.1%
Taylor expanded in z around inf
Applied rewrites60.6%
if -8.5000000000000003e-65 < z < 4.50000000000000013e-19Initial program 90.0%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6466.9
Applied rewrites66.9%
Applied rewrites70.7%
if 4.50000000000000013e-19 < z < 5.7999999999999997e75Initial program 90.8%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6461.3
Applied rewrites61.3%
Taylor expanded in y around inf
Applied rewrites54.1%
Applied rewrites49.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.05e+143) (not (<= z 1.2e+83))) (* (/ z (- t z)) (- x)) (* (/ x (- t z)) (- y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e+143) || !(z <= 1.2e+83)) {
tmp = (z / (t - z)) * -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 <= (-1.05d+143)) .or. (.not. (z <= 1.2d+83))) then
tmp = (z / (t - z)) * -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 <= -1.05e+143) || !(z <= 1.2e+83)) {
tmp = (z / (t - z)) * -x;
} else {
tmp = (x / (t - z)) * (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.05e+143) or not (z <= 1.2e+83): tmp = (z / (t - z)) * -x else: tmp = (x / (t - z)) * (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.05e+143) || !(z <= 1.2e+83)) tmp = Float64(Float64(z / Float64(t - z)) * Float64(-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 <= -1.05e+143) || ~((z <= 1.2e+83))) tmp = (z / (t - z)) * -x; else tmp = (x / (t - z)) * (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.05e+143], N[Not[LessEqual[z, 1.2e+83]], $MachinePrecision]], N[(N[(z / N[(t - z), $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 -1.05 \cdot 10^{+143} \lor \neg \left(z \leq 1.2 \cdot 10^{+83}\right):\\
\;\;\;\;\frac{z}{t - z} \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\
\end{array}
\end{array}
if z < -1.04999999999999994e143 or 1.19999999999999996e83 < z Initial program 69.3%
Taylor expanded in y around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6486.1
Applied rewrites86.1%
if -1.04999999999999994e143 < z < 1.19999999999999996e83Initial program 91.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6494.6
Applied rewrites94.6%
Final simplification91.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.02e-60) (not (<= z 1.75e-40))) (* (/ (- z y) z) x) (* (/ x t) (- y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.02e-60) || !(z <= 1.75e-40)) {
tmp = ((z - y) / z) * x;
} else {
tmp = (x / t) * (y - z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.02d-60)) .or. (.not. (z <= 1.75d-40))) then
tmp = ((z - y) / z) * x
else
tmp = (x / t) * (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.02e-60) || !(z <= 1.75e-40)) {
tmp = ((z - y) / z) * x;
} else {
tmp = (x / t) * (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.02e-60) or not (z <= 1.75e-40): tmp = ((z - y) / z) * x else: tmp = (x / t) * (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.02e-60) || !(z <= 1.75e-40)) tmp = Float64(Float64(Float64(z - y) / z) * x); else tmp = Float64(Float64(x / t) * Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.02e-60) || ~((z <= 1.75e-40))) tmp = ((z - y) / z) * x; else tmp = (x / t) * (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.02e-60], N[Not[LessEqual[z, 1.75e-40]], $MachinePrecision]], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], N[(N[(x / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{-60} \lor \neg \left(z \leq 1.75 \cdot 10^{-40}\right):\\
\;\;\;\;\frac{z - y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} \cdot \left(y - z\right)\\
\end{array}
\end{array}
if z < -1.01999999999999994e-60 or 1.7500000000000001e-40 < z Initial program 79.4%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6469.1
Applied rewrites69.1%
if -1.01999999999999994e-60 < z < 1.7500000000000001e-40Initial program 90.5%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6481.9
Applied rewrites81.9%
Applied rewrites85.7%
Final simplification75.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8.5e-65) (not (<= z 1.9e-24))) (* 1.0 x) (* (/ x t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.5e-65) || !(z <= 1.9e-24)) {
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 <= (-8.5d-65)) .or. (.not. (z <= 1.9d-24))) 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 <= -8.5e-65) || !(z <= 1.9e-24)) {
tmp = 1.0 * x;
} else {
tmp = (x / t) * y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8.5e-65) or not (z <= 1.9e-24): tmp = 1.0 * x else: tmp = (x / t) * y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8.5e-65) || !(z <= 1.9e-24)) 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 <= -8.5e-65) || ~((z <= 1.9e-24))) tmp = 1.0 * x; else tmp = (x / t) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8.5e-65], N[Not[LessEqual[z, 1.9e-24]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-65} \lor \neg \left(z \leq 1.9 \cdot 10^{-24}\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\end{array}
\end{array}
if z < -8.5000000000000003e-65 or 1.90000000000000013e-24 < z Initial program 79.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.2
Applied rewrites99.2%
Taylor expanded in z around inf
Applied rewrites55.1%
if -8.5000000000000003e-65 < z < 1.90000000000000013e-24Initial program 89.9%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6467.5
Applied rewrites67.5%
Applied rewrites71.3%
Final simplification61.9%
(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 83.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6496.0
Applied rewrites96.0%
Taylor expanded in z around inf
Applied rewrites36.1%
(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 2024329
(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)))