
(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 8 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 85.3%
associate-/l*96.8%
Simplified96.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.7e+51)
x
(if (<= z -6.5e-77)
(* (/ x t) (- z))
(if (<= z 5.4e-294) (/ (* x y) t) (if (<= z 3e+57) (/ x (/ t y)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.7e+51) {
tmp = x;
} else if (z <= -6.5e-77) {
tmp = (x / t) * -z;
} else if (z <= 5.4e-294) {
tmp = (x * y) / t;
} else if (z <= 3e+57) {
tmp = x / (t / y);
} 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 <= (-2.7d+51)) then
tmp = x
else if (z <= (-6.5d-77)) then
tmp = (x / t) * -z
else if (z <= 5.4d-294) then
tmp = (x * y) / t
else if (z <= 3d+57) then
tmp = x / (t / y)
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 <= -2.7e+51) {
tmp = x;
} else if (z <= -6.5e-77) {
tmp = (x / t) * -z;
} else if (z <= 5.4e-294) {
tmp = (x * y) / t;
} else if (z <= 3e+57) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.7e+51: tmp = x elif z <= -6.5e-77: tmp = (x / t) * -z elif z <= 5.4e-294: tmp = (x * y) / t elif z <= 3e+57: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.7e+51) tmp = x; elseif (z <= -6.5e-77) tmp = Float64(Float64(x / t) * Float64(-z)); elseif (z <= 5.4e-294) tmp = Float64(Float64(x * y) / t); elseif (z <= 3e+57) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.7e+51) tmp = x; elseif (z <= -6.5e-77) tmp = (x / t) * -z; elseif (z <= 5.4e-294) tmp = (x * y) / t; elseif (z <= 3e+57) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.7e+51], x, If[LessEqual[z, -6.5e-77], N[(N[(x / t), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[z, 5.4e-294], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3e+57], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+51}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-77}:\\
\;\;\;\;\frac{x}{t} \cdot \left(-z\right)\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-294}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+57}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.69999999999999992e51 or 3e57 < z Initial program 76.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 64.1%
if -2.69999999999999992e51 < z < -6.4999999999999999e-77Initial program 83.9%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in t around inf 53.5%
Taylor expanded in y around 0 44.2%
mul-1-neg44.2%
associate-/l*50.7%
distribute-lft-neg-in50.7%
Simplified50.7%
Taylor expanded in x around 0 44.2%
associate-*r/44.2%
neg-mul-144.2%
distribute-rgt-neg-out44.2%
associate-*l/50.9%
Simplified50.9%
if -6.4999999999999999e-77 < z < 5.40000000000000019e-294Initial program 98.0%
associate-/l*85.6%
Simplified85.6%
Taylor expanded in z around 0 84.9%
if 5.40000000000000019e-294 < z < 3e57Initial program 91.4%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in x around 0 91.4%
*-rgt-identity91.4%
times-frac84.1%
/-rgt-identity84.1%
associate-/r/97.3%
Simplified97.3%
Taylor expanded in z around 0 59.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.35e+50)
x
(if (<= z -1.12e-70)
(* x (/ (- z) t))
(if (<= z 1.1e-288) (/ (* x y) t) (if (<= z 3.8e+58) (/ x (/ t y)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e+50) {
tmp = x;
} else if (z <= -1.12e-70) {
tmp = x * (-z / t);
} else if (z <= 1.1e-288) {
tmp = (x * y) / t;
} else if (z <= 3.8e+58) {
tmp = x / (t / y);
} 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 <= (-1.35d+50)) then
tmp = x
else if (z <= (-1.12d-70)) then
tmp = x * (-z / t)
else if (z <= 1.1d-288) then
tmp = (x * y) / t
else if (z <= 3.8d+58) then
tmp = x / (t / y)
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 <= -1.35e+50) {
tmp = x;
} else if (z <= -1.12e-70) {
tmp = x * (-z / t);
} else if (z <= 1.1e-288) {
tmp = (x * y) / t;
} else if (z <= 3.8e+58) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.35e+50: tmp = x elif z <= -1.12e-70: tmp = x * (-z / t) elif z <= 1.1e-288: tmp = (x * y) / t elif z <= 3.8e+58: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.35e+50) tmp = x; elseif (z <= -1.12e-70) tmp = Float64(x * Float64(Float64(-z) / t)); elseif (z <= 1.1e-288) tmp = Float64(Float64(x * y) / t); elseif (z <= 3.8e+58) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.35e+50) tmp = x; elseif (z <= -1.12e-70) tmp = x * (-z / t); elseif (z <= 1.1e-288) tmp = (x * y) / t; elseif (z <= 3.8e+58) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.35e+50], x, If[LessEqual[z, -1.12e-70], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-288], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.8e+58], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.12 \cdot 10^{-70}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-288}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+58}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.35e50 or 3.7999999999999999e58 < z Initial program 76.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 64.1%
if -1.35e50 < z < -1.12e-70Initial program 83.9%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in t around inf 53.5%
Taylor expanded in y around 0 44.2%
mul-1-neg44.2%
associate-/l*50.7%
distribute-lft-neg-in50.7%
Simplified50.7%
if -1.12e-70 < z < 1.1000000000000001e-288Initial program 98.0%
associate-/l*85.6%
Simplified85.6%
Taylor expanded in z around 0 84.9%
if 1.1000000000000001e-288 < z < 3.7999999999999999e58Initial program 91.4%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in x around 0 91.4%
*-rgt-identity91.4%
times-frac84.1%
/-rgt-identity84.1%
associate-/r/97.3%
Simplified97.3%
Taylor expanded in z around 0 59.1%
Final simplification64.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= z -4.8e-57)
t_1
(if (<= z 1.15e-288) (/ (* x y) t) (if (<= z 3e+26) (/ x (/ t y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -4.8e-57) {
tmp = t_1;
} else if (z <= 1.15e-288) {
tmp = (x * y) / t;
} else if (z <= 3e+26) {
tmp = x / (t / y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - (y / z))
if (z <= (-4.8d-57)) then
tmp = t_1
else if (z <= 1.15d-288) then
tmp = (x * y) / t
else if (z <= 3d+26) then
tmp = x / (t / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -4.8e-57) {
tmp = t_1;
} else if (z <= 1.15e-288) {
tmp = (x * y) / t;
} else if (z <= 3e+26) {
tmp = x / (t / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -4.8e-57: tmp = t_1 elif z <= 1.15e-288: tmp = (x * y) / t elif z <= 3e+26: tmp = x / (t / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -4.8e-57) tmp = t_1; elseif (z <= 1.15e-288) tmp = Float64(Float64(x * y) / t); elseif (z <= 3e+26) tmp = Float64(x / Float64(t / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -4.8e-57) tmp = t_1; elseif (z <= 1.15e-288) tmp = (x * y) / t; elseif (z <= 3e+26) tmp = x / (t / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-57], t$95$1, If[LessEqual[z, 1.15e-288], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3e+26], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-288}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+26}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.80000000000000012e-57 or 2.99999999999999997e26 < z Initial program 79.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 57.0%
mul-1-neg57.0%
associate-/l*72.3%
distribute-rgt-neg-in72.3%
distribute-frac-neg72.3%
sub-neg72.3%
distribute-neg-in72.3%
remove-double-neg72.3%
+-commutative72.3%
sub-neg72.3%
div-sub72.2%
*-inverses72.2%
Simplified72.2%
if -4.80000000000000012e-57 < z < 1.15e-288Initial program 96.0%
associate-/l*86.5%
Simplified86.5%
Taylor expanded in z around 0 81.5%
if 1.15e-288 < z < 2.99999999999999997e26Initial program 90.5%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in x around 0 90.5%
*-rgt-identity90.5%
times-frac82.5%
/-rgt-identity82.5%
associate-/r/97.1%
Simplified97.1%
Taylor expanded in z around 0 60.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.5e-71) (not (<= z 3.1e+51))) (* x (/ z (- z t))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.5e-71) || !(z <= 3.1e+51)) {
tmp = x * (z / (z - t));
} 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 <= (-6.5d-71)) .or. (.not. (z <= 3.1d+51))) then
tmp = x * (z / (z - t))
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 <= -6.5e-71) || !(z <= 3.1e+51)) {
tmp = x * (z / (z - t));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6.5e-71) or not (z <= 3.1e+51): tmp = x * (z / (z - t)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.5e-71) || !(z <= 3.1e+51)) tmp = Float64(x * Float64(z / Float64(z - t))); 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 <= -6.5e-71) || ~((z <= 3.1e+51))) tmp = x * (z / (z - t)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.5e-71], N[Not[LessEqual[z, 3.1e+51]], $MachinePrecision]], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-71} \lor \neg \left(z \leq 3.1 \cdot 10^{+51}\right):\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -6.50000000000000005e-71 or 3.10000000000000011e51 < z Initial program 78.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 62.0%
mul-1-neg62.0%
distribute-neg-frac262.0%
sub-neg62.0%
distribute-neg-in62.0%
remove-double-neg62.0%
+-commutative62.0%
sub-neg62.0%
associate-/l*79.6%
Simplified79.6%
if -6.50000000000000005e-71 < z < 3.10000000000000011e51Initial program 93.6%
associate-/l*93.3%
Simplified93.3%
Taylor expanded in y around inf 77.0%
associate-/l*75.8%
Simplified75.8%
Final simplification77.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.08e-29) (not (<= z 4.1e+62))) (* x (- 1.0 (/ y z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.08e-29) || !(z <= 4.1e+62)) {
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 <= (-1.08d-29)) .or. (.not. (z <= 4.1d+62))) 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 <= -1.08e-29) || !(z <= 4.1e+62)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.08e-29) or not (z <= 4.1e+62): 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 <= -1.08e-29) || !(z <= 4.1e+62)) 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 <= -1.08e-29) || ~((z <= 4.1e+62))) 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, -1.08e-29], N[Not[LessEqual[z, 4.1e+62]], $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 -1.08 \cdot 10^{-29} \lor \neg \left(z \leq 4.1 \cdot 10^{+62}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -1.07999999999999995e-29 or 4.09999999999999984e62 < z Initial program 77.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 57.5%
mul-1-neg57.5%
associate-/l*74.7%
distribute-rgt-neg-in74.7%
distribute-frac-neg74.7%
sub-neg74.7%
distribute-neg-in74.7%
remove-double-neg74.7%
+-commutative74.7%
sub-neg74.7%
div-sub74.7%
*-inverses74.7%
Simplified74.7%
if -1.07999999999999995e-29 < z < 4.09999999999999984e62Initial program 92.8%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in y around inf 74.2%
associate-/l*73.8%
Simplified73.8%
Final simplification74.2%
(FPCore (x y z t) :precision binary64 (if (<= z -3.3e-27) x (if (<= z 5.8e+62) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.3e-27) {
tmp = x;
} else if (z <= 5.8e+62) {
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 <= (-3.3d-27)) then
tmp = x
else if (z <= 5.8d+62) 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 <= -3.3e-27) {
tmp = x;
} else if (z <= 5.8e+62) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.3e-27: tmp = x elif z <= 5.8e+62: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.3e-27) tmp = x; elseif (z <= 5.8e+62) 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 <= -3.3e-27) tmp = x; elseif (z <= 5.8e+62) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.3e-27], x, If[LessEqual[z, 5.8e+62], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+62}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.29999999999999998e-27 or 5.79999999999999968e62 < z Initial program 77.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 60.3%
if -3.29999999999999998e-27 < z < 5.79999999999999968e62Initial program 92.8%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in z around 0 60.5%
associate-/l*61.5%
Simplified61.5%
(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 85.3%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 36.5%
(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 2024116
(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)))