
(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 9 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 88.1%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.3
Applied egg-rr98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= z -4.6e+29)
t_1
(if (<= z 1.75e-241)
(* (- y z) (/ x t))
(if (<= z 9.2e+30) (/ (* y x) (- t z)) 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.6e+29) {
tmp = t_1;
} else if (z <= 1.75e-241) {
tmp = (y - z) * (x / t);
} else if (z <= 9.2e+30) {
tmp = (y * x) / (t - 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 = x * (1.0d0 - (y / z))
if (z <= (-4.6d+29)) then
tmp = t_1
else if (z <= 1.75d-241) then
tmp = (y - z) * (x / t)
else if (z <= 9.2d+30) then
tmp = (y * x) / (t - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -4.6e+29) {
tmp = t_1;
} else if (z <= 1.75e-241) {
tmp = (y - z) * (x / t);
} else if (z <= 9.2e+30) {
tmp = (y * x) / (t - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -4.6e+29: tmp = t_1 elif z <= 1.75e-241: tmp = (y - z) * (x / t) elif z <= 9.2e+30: tmp = (y * x) / (t - z) 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.6e+29) tmp = t_1; elseif (z <= 1.75e-241) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 9.2e+30) tmp = Float64(Float64(y * x) / Float64(t - z)); 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.6e+29) tmp = t_1; elseif (z <= 1.75e-241) tmp = (y - z) * (x / t); elseif (z <= 9.2e+30) tmp = (y * x) / (t - z); 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.6e+29], t$95$1, If[LessEqual[z, 1.75e-241], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+30], N[(N[(y * x), $MachinePrecision] / N[(t - z), $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.6 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-241}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+30}:\\
\;\;\;\;\frac{y \cdot x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.6000000000000002e29 or 9.2e30 < z Initial program 81.4%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6477.3
Simplified77.3%
if -4.6000000000000002e29 < z < 1.7499999999999999e-241Initial program 92.2%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6477.7
Simplified77.7%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6481.8
Applied egg-rr81.8%
if 1.7499999999999999e-241 < z < 9.2e30Initial program 96.7%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6477.1
Simplified77.1%
Final simplification78.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= z -2.5e+171)
t_1
(if (<= z 1.75e+127) (* (- y z) (/ x (- t z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -2.5e+171) {
tmp = t_1;
} else if (z <= 1.75e+127) {
tmp = (y - z) * (x / (t - 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 = x * (1.0d0 - (y / z))
if (z <= (-2.5d+171)) then
tmp = t_1
else if (z <= 1.75d+127) then
tmp = (y - z) * (x / (t - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -2.5e+171) {
tmp = t_1;
} else if (z <= 1.75e+127) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -2.5e+171: tmp = t_1 elif z <= 1.75e+127: tmp = (y - z) * (x / (t - z)) 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 <= -2.5e+171) tmp = t_1; elseif (z <= 1.75e+127) tmp = Float64(Float64(y - z) * Float64(x / Float64(t - z))); 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 <= -2.5e+171) tmp = t_1; elseif (z <= 1.75e+127) tmp = (y - z) * (x / (t - z)); 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, -2.5e+171], t$95$1, If[LessEqual[z, 1.75e+127], N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $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 -2.5 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+127}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.5000000000000002e171 or 1.74999999999999989e127 < z Initial program 72.3%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6488.5
Simplified88.5%
if -2.5000000000000002e171 < z < 1.74999999999999989e127Initial program 93.5%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6490.2
Applied egg-rr90.2%
Final simplification89.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ (- y z) t)))) (if (<= t -6e+54) t_1 (if (<= t 0.00014) (* x (- 1.0 (/ y z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double tmp;
if (t <= -6e+54) {
tmp = t_1;
} else if (t <= 0.00014) {
tmp = x * (1.0 - (y / 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 = x * ((y - z) / t)
if (t <= (-6d+54)) then
tmp = t_1
else if (t <= 0.00014d0) then
tmp = x * (1.0d0 - (y / z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double tmp;
if (t <= -6e+54) {
tmp = t_1;
} else if (t <= 0.00014) {
tmp = x * (1.0 - (y / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y - z) / t) tmp = 0 if t <= -6e+54: tmp = t_1 elif t <= 0.00014: tmp = x * (1.0 - (y / z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y - z) / t)) tmp = 0.0 if (t <= -6e+54) tmp = t_1; elseif (t <= 0.00014) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y - z) / t); tmp = 0.0; if (t <= -6e+54) tmp = t_1; elseif (t <= 0.00014) tmp = x * (1.0 - (y / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6e+54], t$95$1, If[LessEqual[t, 0.00014], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y - z}{t}\\
\mathbf{if}\;t \leq -6 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 0.00014:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.9999999999999998e54 or 1.3999999999999999e-4 < t Initial program 87.0%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6473.0
Simplified73.0%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6476.2
Applied egg-rr76.2%
if -5.9999999999999998e54 < t < 1.3999999999999999e-4Initial program 89.1%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6476.0
Simplified76.0%
Final simplification76.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y z))))) (if (<= z -9.8e+27) t_1 (if (<= z 1.6e-20) (* (- y z) (/ x t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -9.8e+27) {
tmp = t_1;
} else if (z <= 1.6e-20) {
tmp = (y - z) * (x / t);
} 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 <= (-9.8d+27)) then
tmp = t_1
else if (z <= 1.6d-20) then
tmp = (y - z) * (x / t)
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 <= -9.8e+27) {
tmp = t_1;
} else if (z <= 1.6e-20) {
tmp = (y - z) * (x / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -9.8e+27: tmp = t_1 elif z <= 1.6e-20: tmp = (y - z) * (x / t) 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 <= -9.8e+27) tmp = t_1; elseif (z <= 1.6e-20) tmp = Float64(Float64(y - z) * Float64(x / t)); 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 <= -9.8e+27) tmp = t_1; elseif (z <= 1.6e-20) tmp = (y - z) * (x / t); 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, -9.8e+27], t$95$1, If[LessEqual[z, 1.6e-20], N[(N[(y - z), $MachinePrecision] * N[(x / t), $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 -9.8 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-20}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.8000000000000003e27 or 1.59999999999999985e-20 < z Initial program 83.2%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6475.3
Simplified75.3%
if -9.8000000000000003e27 < z < 1.59999999999999985e-20Initial program 93.7%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6474.3
Simplified74.3%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6475.0
Applied egg-rr75.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y z))))) (if (<= z -5.6e-95) t_1 (if (<= z 2.9e-11) (* x (/ y t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -5.6e-95) {
tmp = t_1;
} else if (z <= 2.9e-11) {
tmp = x * (y / t);
} 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 <= (-5.6d-95)) then
tmp = t_1
else if (z <= 2.9d-11) then
tmp = x * (y / t)
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 <= -5.6e-95) {
tmp = t_1;
} else if (z <= 2.9e-11) {
tmp = x * (y / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -5.6e-95: tmp = t_1 elif z <= 2.9e-11: tmp = x * (y / t) 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 <= -5.6e-95) tmp = t_1; elseif (z <= 2.9e-11) tmp = Float64(x * Float64(y / t)); 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 <= -5.6e-95) tmp = t_1; elseif (z <= 2.9e-11) tmp = x * (y / t); 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, -5.6e-95], t$95$1, If[LessEqual[z, 2.9e-11], N[(x * N[(y / t), $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 -5.6 \cdot 10^{-95}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.5999999999999998e-95 or 2.9e-11 < z Initial program 84.0%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6470.8
Simplified70.8%
if -5.5999999999999998e-95 < z < 2.9e-11Initial program 94.4%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.1
Applied egg-rr96.1%
Taylor expanded in z around 0
/-lowering-/.f6473.2
Simplified73.2%
Final simplification71.8%
(FPCore (x y z t) :precision binary64 (if (<= z -2.4e+28) x (if (<= z 4.1e+30) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.4e+28) {
tmp = x;
} else if (z <= 4.1e+30) {
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 <= (-2.4d+28)) then
tmp = x
else if (z <= 4.1d+30) 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 <= -2.4e+28) {
tmp = x;
} else if (z <= 4.1e+30) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.4e+28: tmp = x elif z <= 4.1e+30: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.4e+28) tmp = x; elseif (z <= 4.1e+30) 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 <= -2.4e+28) tmp = x; elseif (z <= 4.1e+30) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.4e+28], x, If[LessEqual[z, 4.1e+30], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+28}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+30}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.39999999999999981e28 or 4.10000000000000005e30 < z Initial program 81.4%
Taylor expanded in z around inf
Simplified58.9%
if -2.39999999999999981e28 < z < 4.10000000000000005e30Initial program 94.3%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.0
Applied egg-rr97.0%
Taylor expanded in z around 0
/-lowering-/.f6463.9
Simplified63.9%
Final simplification61.5%
(FPCore (x y z t) :precision binary64 (if (<= z -7.3e+28) x (if (<= z 3.1e+30) (* y (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.3e+28) {
tmp = x;
} else if (z <= 3.1e+30) {
tmp = y * (x / 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 <= (-7.3d+28)) then
tmp = x
else if (z <= 3.1d+30) then
tmp = y * (x / 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 <= -7.3e+28) {
tmp = x;
} else if (z <= 3.1e+30) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.3e+28: tmp = x elif z <= 3.1e+30: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.3e+28) tmp = x; elseif (z <= 3.1e+30) tmp = Float64(y * Float64(x / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -7.3e+28) tmp = x; elseif (z <= 3.1e+30) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.3e+28], x, If[LessEqual[z, 3.1e+30], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.3 \cdot 10^{+28}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+30}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.2999999999999998e28 or 3.0999999999999998e30 < z Initial program 81.4%
Taylor expanded in z around inf
Simplified58.9%
if -7.2999999999999998e28 < z < 3.0999999999999998e30Initial program 94.3%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.7
Applied egg-rr94.7%
Taylor expanded in t around inf
/-lowering-/.f6472.5
Simplified72.5%
Taylor expanded in y around inf
Simplified62.8%
Final simplification61.0%
(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 88.1%
Taylor expanded in z around inf
Simplified34.4%
(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 2024196
(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)))