
(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 10 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 (/ (- 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(x * Float64(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[(x * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y - z}{t - z}
\end{array}
Initial program 84.1%
associate-/l*97.2%
Simplified97.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.7e+109)
(- x (* x (/ y z)))
(if (<= z 1.1e-165)
(/ x (/ t (- y z)))
(if (<= z 1.7e+95) (/ x (/ (- t z) y)) (* x (/ z (- z t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+109) {
tmp = x - (x * (y / z));
} else if (z <= 1.1e-165) {
tmp = x / (t / (y - z));
} else if (z <= 1.7e+95) {
tmp = x / ((t - z) / y);
} else {
tmp = x * (z / (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 <= (-3.7d+109)) then
tmp = x - (x * (y / z))
else if (z <= 1.1d-165) then
tmp = x / (t / (y - z))
else if (z <= 1.7d+95) then
tmp = x / ((t - z) / y)
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+109) {
tmp = x - (x * (y / z));
} else if (z <= 1.1e-165) {
tmp = x / (t / (y - z));
} else if (z <= 1.7e+95) {
tmp = x / ((t - z) / y);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.7e+109: tmp = x - (x * (y / z)) elif z <= 1.1e-165: tmp = x / (t / (y - z)) elif z <= 1.7e+95: tmp = x / ((t - z) / y) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.7e+109) tmp = Float64(x - Float64(x * Float64(y / z))); elseif (z <= 1.1e-165) tmp = Float64(x / Float64(t / Float64(y - z))); elseif (z <= 1.7e+95) tmp = Float64(x / Float64(Float64(t - z) / y)); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.7e+109) tmp = x - (x * (y / z)); elseif (z <= 1.1e-165) tmp = x / (t / (y - z)); elseif (z <= 1.7e+95) tmp = x / ((t - z) / y); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.7e+109], N[(x - N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-165], N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+95], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+109}:\\
\;\;\;\;x - x \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-165}:\\
\;\;\;\;\frac{x}{\frac{t}{y - z}}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+95}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -3.7000000000000002e109Initial program 65.2%
remove-double-neg65.2%
distribute-lft-neg-out65.2%
distribute-neg-frac65.2%
distribute-neg-frac265.2%
distribute-lft-neg-out65.2%
distribute-rgt-neg-in65.2%
sub-neg65.2%
distribute-neg-in65.2%
remove-double-neg65.2%
+-commutative65.2%
sub-neg65.2%
sub-neg65.2%
distribute-neg-in65.2%
remove-double-neg65.2%
+-commutative65.2%
sub-neg65.2%
Simplified65.2%
Taylor expanded in t around 0 60.4%
Taylor expanded in z around inf 79.5%
mul-1-neg79.5%
unsub-neg79.5%
associate-/l*94.1%
Simplified94.1%
if -3.7000000000000002e109 < z < 1.0999999999999999e-165Initial program 92.3%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in x around 0 92.3%
*-rgt-identity92.3%
times-frac93.2%
/-rgt-identity93.2%
associate-/r/98.0%
Simplified98.0%
Taylor expanded in t around inf 79.0%
if 1.0999999999999999e-165 < z < 1.70000000000000011e95Initial program 93.6%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in x around 0 93.6%
*-rgt-identity93.6%
times-frac95.3%
/-rgt-identity95.3%
associate-/r/92.1%
Simplified92.1%
Taylor expanded in y around inf 66.0%
if 1.70000000000000011e95 < z Initial program 72.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 63.8%
mul-1-neg63.8%
distribute-neg-frac263.8%
sub-neg63.8%
distribute-neg-in63.8%
remove-double-neg63.8%
+-commutative63.8%
sub-neg63.8%
associate-/l*88.4%
Simplified88.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.6e+107)
(- x (* x (/ y z)))
(if (<= z 1.95e-165)
(/ x (/ t (- y z)))
(if (<= z 1.25e+98) (* x (/ y (- t z))) (* x (/ z (- z t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+107) {
tmp = x - (x * (y / z));
} else if (z <= 1.95e-165) {
tmp = x / (t / (y - z));
} else if (z <= 1.25e+98) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (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 <= (-3.6d+107)) then
tmp = x - (x * (y / z))
else if (z <= 1.95d-165) then
tmp = x / (t / (y - z))
else if (z <= 1.25d+98) then
tmp = x * (y / (t - z))
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+107) {
tmp = x - (x * (y / z));
} else if (z <= 1.95e-165) {
tmp = x / (t / (y - z));
} else if (z <= 1.25e+98) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.6e+107: tmp = x - (x * (y / z)) elif z <= 1.95e-165: tmp = x / (t / (y - z)) elif z <= 1.25e+98: tmp = x * (y / (t - z)) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.6e+107) tmp = Float64(x - Float64(x * Float64(y / z))); elseif (z <= 1.95e-165) tmp = Float64(x / Float64(t / Float64(y - z))); elseif (z <= 1.25e+98) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.6e+107) tmp = x - (x * (y / z)); elseif (z <= 1.95e-165) tmp = x / (t / (y - z)); elseif (z <= 1.25e+98) tmp = x * (y / (t - z)); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.6e+107], N[(x - N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e-165], N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+98], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+107}:\\
\;\;\;\;x - x \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-165}:\\
\;\;\;\;\frac{x}{\frac{t}{y - z}}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+98}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -3.5999999999999998e107Initial program 65.2%
remove-double-neg65.2%
distribute-lft-neg-out65.2%
distribute-neg-frac65.2%
distribute-neg-frac265.2%
distribute-lft-neg-out65.2%
distribute-rgt-neg-in65.2%
sub-neg65.2%
distribute-neg-in65.2%
remove-double-neg65.2%
+-commutative65.2%
sub-neg65.2%
sub-neg65.2%
distribute-neg-in65.2%
remove-double-neg65.2%
+-commutative65.2%
sub-neg65.2%
Simplified65.2%
Taylor expanded in t around 0 60.4%
Taylor expanded in z around inf 79.5%
mul-1-neg79.5%
unsub-neg79.5%
associate-/l*94.1%
Simplified94.1%
if -3.5999999999999998e107 < z < 1.9499999999999999e-165Initial program 92.3%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in x around 0 92.3%
*-rgt-identity92.3%
times-frac93.2%
/-rgt-identity93.2%
associate-/r/98.0%
Simplified98.0%
Taylor expanded in t around inf 79.0%
if 1.9499999999999999e-165 < z < 1.25e98Initial program 93.6%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in y around inf 64.3%
associate-/l*65.9%
Simplified65.9%
if 1.25e98 < z Initial program 72.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 63.8%
mul-1-neg63.8%
distribute-neg-frac263.8%
sub-neg63.8%
distribute-neg-in63.8%
remove-double-neg63.8%
+-commutative63.8%
sub-neg63.8%
associate-/l*88.4%
Simplified88.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.1e+109)
(- x (* x (/ y z)))
(if (<= z 2.65e-166)
(* x (/ (- y z) t))
(if (<= z 2e+98) (* x (/ y (- t z))) (* x (/ z (- z t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.1e+109) {
tmp = x - (x * (y / z));
} else if (z <= 2.65e-166) {
tmp = x * ((y - z) / t);
} else if (z <= 2e+98) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (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 <= (-3.1d+109)) then
tmp = x - (x * (y / z))
else if (z <= 2.65d-166) then
tmp = x * ((y - z) / t)
else if (z <= 2d+98) then
tmp = x * (y / (t - z))
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.1e+109) {
tmp = x - (x * (y / z));
} else if (z <= 2.65e-166) {
tmp = x * ((y - z) / t);
} else if (z <= 2e+98) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.1e+109: tmp = x - (x * (y / z)) elif z <= 2.65e-166: tmp = x * ((y - z) / t) elif z <= 2e+98: tmp = x * (y / (t - z)) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.1e+109) tmp = Float64(x - Float64(x * Float64(y / z))); elseif (z <= 2.65e-166) tmp = Float64(x * Float64(Float64(y - z) / t)); elseif (z <= 2e+98) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.1e+109) tmp = x - (x * (y / z)); elseif (z <= 2.65e-166) tmp = x * ((y - z) / t); elseif (z <= 2e+98) tmp = x * (y / (t - z)); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.1e+109], N[(x - N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.65e-166], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+98], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+109}:\\
\;\;\;\;x - x \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{-166}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+98}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -3.09999999999999992e109Initial program 65.2%
remove-double-neg65.2%
distribute-lft-neg-out65.2%
distribute-neg-frac65.2%
distribute-neg-frac265.2%
distribute-lft-neg-out65.2%
distribute-rgt-neg-in65.2%
sub-neg65.2%
distribute-neg-in65.2%
remove-double-neg65.2%
+-commutative65.2%
sub-neg65.2%
sub-neg65.2%
distribute-neg-in65.2%
remove-double-neg65.2%
+-commutative65.2%
sub-neg65.2%
Simplified65.2%
Taylor expanded in t around 0 60.4%
Taylor expanded in z around inf 79.5%
mul-1-neg79.5%
unsub-neg79.5%
associate-/l*94.1%
Simplified94.1%
if -3.09999999999999992e109 < z < 2.64999999999999998e-166Initial program 92.3%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in t around inf 72.8%
associate-/l*79.0%
Simplified79.0%
if 2.64999999999999998e-166 < z < 2e98Initial program 93.6%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in y around inf 64.3%
associate-/l*65.9%
Simplified65.9%
if 2e98 < z Initial program 72.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 63.8%
mul-1-neg63.8%
distribute-neg-frac263.8%
sub-neg63.8%
distribute-neg-in63.8%
remove-double-neg63.8%
+-commutative63.8%
sub-neg63.8%
associate-/l*88.4%
Simplified88.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.6e+107)
(* x (- 1.0 (/ y z)))
(if (<= z 2.8e-165)
(* x (/ (- y z) t))
(if (<= z 7.5e+95) (* x (/ y (- t z))) (* x (/ z (- z t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+107) {
tmp = x * (1.0 - (y / z));
} else if (z <= 2.8e-165) {
tmp = x * ((y - z) / t);
} else if (z <= 7.5e+95) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (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 <= (-3.6d+107)) then
tmp = x * (1.0d0 - (y / z))
else if (z <= 2.8d-165) then
tmp = x * ((y - z) / t)
else if (z <= 7.5d+95) then
tmp = x * (y / (t - z))
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+107) {
tmp = x * (1.0 - (y / z));
} else if (z <= 2.8e-165) {
tmp = x * ((y - z) / t);
} else if (z <= 7.5e+95) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.6e+107: tmp = x * (1.0 - (y / z)) elif z <= 2.8e-165: tmp = x * ((y - z) / t) elif z <= 7.5e+95: tmp = x * (y / (t - z)) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.6e+107) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (z <= 2.8e-165) tmp = Float64(x * Float64(Float64(y - z) / t)); elseif (z <= 7.5e+95) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.6e+107) tmp = x * (1.0 - (y / z)); elseif (z <= 2.8e-165) tmp = x * ((y - z) / t); elseif (z <= 7.5e+95) tmp = x * (y / (t - z)); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.6e+107], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e-165], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+95], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+107}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-165}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+95}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -3.5999999999999998e107Initial program 65.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 60.4%
mul-1-neg60.4%
associate-/l*94.0%
distribute-rgt-neg-in94.0%
distribute-frac-neg94.0%
sub-neg94.0%
distribute-neg-in94.0%
remove-double-neg94.0%
+-commutative94.0%
sub-neg94.0%
div-sub94.0%
*-inverses94.0%
Simplified94.0%
if -3.5999999999999998e107 < z < 2.7999999999999999e-165Initial program 92.3%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in t around inf 72.8%
associate-/l*79.0%
Simplified79.0%
if 2.7999999999999999e-165 < z < 7.5000000000000001e95Initial program 93.6%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in y around inf 64.3%
associate-/l*65.9%
Simplified65.9%
if 7.5000000000000001e95 < z Initial program 72.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 63.8%
mul-1-neg63.8%
distribute-neg-frac263.8%
sub-neg63.8%
distribute-neg-in63.8%
remove-double-neg63.8%
+-commutative63.8%
sub-neg63.8%
associate-/l*88.4%
Simplified88.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.2e+107) (not (<= z 1.45e+59))) (* x (- 1.0 (/ y z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.2e+107) || !(z <= 1.45e+59)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (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 <= (-4.2d+107)) .or. (.not. (z <= 1.45d+59))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.2e+107) || !(z <= 1.45e+59)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.2e+107) or not (z <= 1.45e+59): tmp = x * (1.0 - (y / z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.2e+107) || !(z <= 1.45e+59)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.2e+107) || ~((z <= 1.45e+59))) tmp = x * (1.0 - (y / z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.2e+107], N[Not[LessEqual[z, 1.45e+59]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+107} \lor \neg \left(z \leq 1.45 \cdot 10^{+59}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -4.1999999999999999e107 or 1.44999999999999995e59 < z Initial program 72.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 60.0%
mul-1-neg60.0%
associate-/l*85.5%
distribute-rgt-neg-in85.5%
distribute-frac-neg85.5%
sub-neg85.5%
distribute-neg-in85.5%
remove-double-neg85.5%
+-commutative85.5%
sub-neg85.5%
div-sub85.5%
*-inverses85.5%
Simplified85.5%
if -4.1999999999999999e107 < z < 1.44999999999999995e59Initial program 92.3%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in y around inf 69.9%
associate-/l*71.4%
Simplified71.4%
Final simplification77.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.55e-88) (not (<= z 3.05e-37))) (* x (- 1.0 (/ y z))) (* x (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.55e-88) || !(z <= 3.05e-37)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / 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.55d-88)) .or. (.not. (z <= 3.05d-37))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.55e-88) || !(z <= 3.05e-37)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.55e-88) or not (z <= 3.05e-37): tmp = x * (1.0 - (y / z)) else: tmp = x * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.55e-88) || !(z <= 3.05e-37)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.55e-88) || ~((z <= 3.05e-37))) tmp = x * (1.0 - (y / z)); else tmp = x * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.55e-88], N[Not[LessEqual[z, 3.05e-37]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-88} \lor \neg \left(z \leq 3.05 \cdot 10^{-37}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -1.5499999999999999e-88 or 3.0500000000000002e-37 < z Initial program 77.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 54.9%
mul-1-neg54.9%
associate-/l*73.0%
distribute-rgt-neg-in73.0%
distribute-frac-neg73.0%
sub-neg73.0%
distribute-neg-in73.0%
remove-double-neg73.0%
+-commutative73.0%
sub-neg73.0%
div-sub73.0%
*-inverses73.0%
Simplified73.0%
if -1.5499999999999999e-88 < z < 3.0500000000000002e-37Initial program 93.4%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in z around 0 60.8%
associate-/l*64.4%
Simplified64.4%
Final simplification69.6%
(FPCore (x y z t) :precision binary64 (if (<= z -3.6e+107) (* x (- 1.0 (/ y z))) (if (<= z 4.05e+96) (* x (/ y (- t z))) (* x (/ z (- z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+107) {
tmp = x * (1.0 - (y / z));
} else if (z <= 4.05e+96) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (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 <= (-3.6d+107)) then
tmp = x * (1.0d0 - (y / z))
else if (z <= 4.05d+96) then
tmp = x * (y / (t - z))
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+107) {
tmp = x * (1.0 - (y / z));
} else if (z <= 4.05e+96) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.6e+107: tmp = x * (1.0 - (y / z)) elif z <= 4.05e+96: tmp = x * (y / (t - z)) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.6e+107) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (z <= 4.05e+96) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.6e+107) tmp = x * (1.0 - (y / z)); elseif (z <= 4.05e+96) tmp = x * (y / (t - z)); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.6e+107], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.05e+96], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+107}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 4.05 \cdot 10^{+96}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -3.5999999999999998e107Initial program 65.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 60.4%
mul-1-neg60.4%
associate-/l*94.0%
distribute-rgt-neg-in94.0%
distribute-frac-neg94.0%
sub-neg94.0%
distribute-neg-in94.0%
remove-double-neg94.0%
+-commutative94.0%
sub-neg94.0%
div-sub94.0%
*-inverses94.0%
Simplified94.0%
if -3.5999999999999998e107 < z < 4.0500000000000001e96Initial program 92.8%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in y around inf 69.3%
associate-/l*70.8%
Simplified70.8%
if 4.0500000000000001e96 < z Initial program 72.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 63.8%
mul-1-neg63.8%
distribute-neg-frac263.8%
sub-neg63.8%
distribute-neg-in63.8%
remove-double-neg63.8%
+-commutative63.8%
sub-neg63.8%
associate-/l*88.4%
Simplified88.4%
(FPCore (x y z t) :precision binary64 (if (<= z -4.7e+107) x (if (<= z 2.65e+66) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.7e+107) {
tmp = x;
} else if (z <= 2.65e+66) {
tmp = x * (y / t);
} else {
tmp = 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.7d+107)) then
tmp = x
else if (z <= 2.65d+66) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.7e+107) {
tmp = x;
} else if (z <= 2.65e+66) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.7e+107: tmp = x elif z <= 2.65e+66: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.7e+107) tmp = x; elseif (z <= 2.65e+66) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.7e+107) tmp = x; elseif (z <= 2.65e+66) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.7e+107], x, If[LessEqual[z, 2.65e+66], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{+107}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{+66}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.7000000000000001e107 or 2.6499999999999998e66 < z Initial program 71.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 71.2%
if -4.7000000000000001e107 < z < 2.6499999999999998e66Initial program 92.5%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in z around 0 52.9%
associate-/l*56.2%
Simplified56.2%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return 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 = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 84.1%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 35.7%
(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 2024181
(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)))