
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (<= t_1 -2e+281)
(+ x (* (- z t) (/ y (- z a))))
(if (<= t_1 5e+282) (+ x t_1) (+ x (/ (- z t) (/ (- z a) y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -2e+281) {
tmp = x + ((z - t) * (y / (z - a)));
} else if (t_1 <= 5e+282) {
tmp = x + t_1;
} else {
tmp = x + ((z - t) / ((z - a) / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / (z - a)
if (t_1 <= (-2d+281)) then
tmp = x + ((z - t) * (y / (z - a)))
else if (t_1 <= 5d+282) then
tmp = x + t_1
else
tmp = x + ((z - t) / ((z - a) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -2e+281) {
tmp = x + ((z - t) * (y / (z - a)));
} else if (t_1 <= 5e+282) {
tmp = x + t_1;
} else {
tmp = x + ((z - t) / ((z - a) / y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if t_1 <= -2e+281: tmp = x + ((z - t) * (y / (z - a))) elif t_1 <= 5e+282: tmp = x + t_1 else: tmp = x + ((z - t) / ((z - a) / y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if (t_1 <= -2e+281) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); elseif (t_1 <= 5e+282) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if (t_1 <= -2e+281) tmp = x + ((z - t) * (y / (z - a))); elseif (t_1 <= 5e+282) tmp = x + t_1; else tmp = x + ((z - t) / ((z - a) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+281], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+282], N[(x + t$95$1), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+281}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+282}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -2.0000000000000001e281Initial program 49.6%
associate-*l/99.9%
Simplified99.9%
if -2.0000000000000001e281 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 4.99999999999999978e282Initial program 99.4%
if 4.99999999999999978e282 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 33.5%
associate-*l/99.7%
Simplified99.7%
*-commutative99.7%
clear-num99.6%
un-div-inv99.8%
Applied egg-rr99.8%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (+ x (pow (cbrt (/ y (/ (- z a) (- z t)))) 3.0)))
double code(double x, double y, double z, double t, double a) {
return x + pow(cbrt((y / ((z - a) / (z - t)))), 3.0);
}
public static double code(double x, double y, double z, double t, double a) {
return x + Math.pow(Math.cbrt((y / ((z - a) / (z - t)))), 3.0);
}
function code(x, y, z, t, a) return Float64(x + (cbrt(Float64(y / Float64(Float64(z - a) / Float64(z - t)))) ^ 3.0)) end
code[x_, y_, z_, t_, a_] := N[(x + N[Power[N[Power[N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + {\left(\sqrt[3]{\frac{y}{\frac{z - a}{z - t}}}\right)}^{3}
\end{array}
Initial program 84.7%
associate-*l/96.1%
Simplified96.1%
add-cube-cbrt95.5%
pow395.5%
associate-*l/84.2%
associate-/l*98.5%
Applied egg-rr98.5%
Final simplification98.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 -2e+281) (not (<= t_1 5e+282)))
(+ x (* (- z t) (/ y (- z a))))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -2e+281) || !(t_1 <= 5e+282)) {
tmp = x + ((z - t) * (y / (z - a)));
} else {
tmp = x + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / (z - a)
if ((t_1 <= (-2d+281)) .or. (.not. (t_1 <= 5d+282))) then
tmp = x + ((z - t) * (y / (z - a)))
else
tmp = x + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -2e+281) || !(t_1 <= 5e+282)) {
tmp = x + ((z - t) * (y / (z - a)));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -2e+281) or not (t_1 <= 5e+282): tmp = x + ((z - t) * (y / (z - a))) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= -2e+281) || !(t_1 <= 5e+282)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if ((t_1 <= -2e+281) || ~((t_1 <= 5e+282))) tmp = x + ((z - t) * (y / (z - a))); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+281], N[Not[LessEqual[t$95$1, 5e+282]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+281} \lor \neg \left(t_1 \leq 5 \cdot 10^{+282}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -2.0000000000000001e281 or 4.99999999999999978e282 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 42.3%
associate-*l/99.8%
Simplified99.8%
if -2.0000000000000001e281 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 4.99999999999999978e282Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.02e-22) (not (<= z 5.6e-143))) (+ x (* (- z t) (/ y z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.02e-22) || !(z <= 5.6e-143)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.02d-22)) .or. (.not. (z <= 5.6d-143))) then
tmp = x + ((z - t) * (y / z))
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.02e-22) || !(z <= 5.6e-143)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.02e-22) or not (z <= 5.6e-143): tmp = x + ((z - t) * (y / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.02e-22) || !(z <= 5.6e-143)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.02e-22) || ~((z <= 5.6e-143))) tmp = x + ((z - t) * (y / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.02e-22], N[Not[LessEqual[z, 5.6e-143]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{-22} \lor \neg \left(z \leq 5.6 \cdot 10^{-143}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.02000000000000002e-22 or 5.5999999999999997e-143 < z Initial program 80.6%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in a around 0 70.8%
associate-/l*87.0%
associate-/r/82.8%
Simplified82.8%
if -1.02000000000000002e-22 < z < 5.5999999999999997e-143Initial program 90.2%
associate-*l/97.3%
Simplified97.3%
add-cube-cbrt96.8%
pow396.8%
associate-*l/89.7%
associate-/l*98.5%
Applied egg-rr98.5%
rem-cube-cbrt99.0%
div-inv99.0%
associate-/r*97.3%
Applied egg-rr97.3%
Taylor expanded in z around 0 82.4%
*-commutative82.4%
associate-/l*90.3%
Simplified90.3%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.88e-19) (not (<= z 3.2e-140))) (+ x (* y (/ (- z t) z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.88e-19) || !(z <= 3.2e-140)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.88d-19)) .or. (.not. (z <= 3.2d-140))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.88e-19) || !(z <= 3.2e-140)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.88e-19) or not (z <= 3.2e-140): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.88e-19) || !(z <= 3.2e-140)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.88e-19) || ~((z <= 3.2e-140))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.88e-19], N[Not[LessEqual[z, 3.2e-140]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.88 \cdot 10^{-19} \lor \neg \left(z \leq 3.2 \cdot 10^{-140}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.88000000000000006e-19 or 3.2000000000000001e-140 < z Initial program 80.3%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in a around 0 70.4%
associate-/l*87.4%
Simplified87.4%
clear-num87.4%
associate-/r/87.4%
clear-num87.4%
Applied egg-rr87.4%
if -1.88000000000000006e-19 < z < 3.2000000000000001e-140Initial program 90.4%
associate-*l/97.4%
Simplified97.4%
add-cube-cbrt96.9%
pow396.9%
associate-*l/89.9%
associate-/l*97.7%
Applied egg-rr97.7%
rem-cube-cbrt98.2%
div-inv98.2%
associate-/r*97.3%
Applied egg-rr97.3%
Taylor expanded in z around 0 81.9%
*-commutative81.9%
associate-/l*89.6%
Simplified89.6%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e-17) (not (<= z 3.2e-140))) (+ x (/ y (/ z (- z t)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e-17) || !(z <= 3.2e-140)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.5d-17)) .or. (.not. (z <= 3.2d-140))) then
tmp = x + (y / (z / (z - t)))
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e-17) || !(z <= 3.2e-140)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e-17) or not (z <= 3.2e-140): tmp = x + (y / (z / (z - t))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e-17) || !(z <= 3.2e-140)) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.5e-17) || ~((z <= 3.2e-140))) tmp = x + (y / (z / (z - t))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.5e-17], N[Not[LessEqual[z, 3.2e-140]], $MachinePrecision]], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-17} \lor \neg \left(z \leq 3.2 \cdot 10^{-140}\right):\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -3.5000000000000002e-17 or 3.2000000000000001e-140 < z Initial program 80.3%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in a around 0 70.4%
associate-/l*87.4%
Simplified87.4%
if -3.5000000000000002e-17 < z < 3.2000000000000001e-140Initial program 90.4%
associate-*l/97.4%
Simplified97.4%
add-cube-cbrt96.9%
pow396.9%
associate-*l/89.9%
associate-/l*97.7%
Applied egg-rr97.7%
rem-cube-cbrt98.2%
div-inv98.2%
associate-/r*97.3%
Applied egg-rr97.3%
Taylor expanded in z around 0 81.9%
*-commutative81.9%
associate-/l*89.6%
Simplified89.6%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.3e+20) (+ x y) (if (<= z 6.8e-134) (+ x (/ y (/ a t))) (+ x (* z (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+20) {
tmp = x + y;
} else if (z <= 6.8e-134) {
tmp = x + (y / (a / t));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.3d+20)) then
tmp = x + y
else if (z <= 6.8d-134) then
tmp = x + (y / (a / t))
else
tmp = x + (z * (y / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+20) {
tmp = x + y;
} else if (z <= 6.8e-134) {
tmp = x + (y / (a / t));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.3e+20: tmp = x + y elif z <= 6.8e-134: tmp = x + (y / (a / t)) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e+20) tmp = Float64(x + y); elseif (z <= 6.8e-134) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.3e+20) tmp = x + y; elseif (z <= 6.8e-134) tmp = x + (y / (a / t)); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e+20], N[(x + y), $MachinePrecision], If[LessEqual[z, 6.8e-134], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+20}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-134}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -2.3e20Initial program 72.8%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in z around inf 86.1%
if -2.3e20 < z < 6.79999999999999954e-134Initial program 91.3%
associate-*l/97.6%
Simplified97.6%
add-cube-cbrt97.0%
pow397.0%
associate-*l/90.8%
associate-/l*97.8%
Applied egg-rr97.8%
rem-cube-cbrt98.4%
div-inv98.3%
associate-/r*97.6%
Applied egg-rr97.6%
Taylor expanded in z around 0 79.4%
*-commutative79.4%
associate-/l*86.3%
Simplified86.3%
if 6.79999999999999954e-134 < z Initial program 82.3%
associate-*l/94.8%
Simplified94.8%
Taylor expanded in t around 0 69.9%
associate-*l/78.8%
*-commutative78.8%
Simplified78.8%
Final simplification83.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.6e+20)
(+ x (/ y (/ z (- z t))))
(if (<= z 4100000000.0)
(- x (* t (/ y (- z a))))
(+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e+20) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 4100000000.0) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.6d+20)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 4100000000.0d0) then
tmp = x - (t * (y / (z - a)))
else
tmp = x + (y * ((z - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e+20) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 4100000000.0) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.6e+20: tmp = x + (y / (z / (z - t))) elif z <= 4100000000.0: tmp = x - (t * (y / (z - a))) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.6e+20) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 4100000000.0) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.6e+20) tmp = x + (y / (z / (z - t))); elseif (z <= 4100000000.0) tmp = x - (t * (y / (z - a))); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.6e+20], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4100000000.0], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+20}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 4100000000:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -2.6e20Initial program 72.8%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in a around 0 72.7%
associate-/l*94.4%
Simplified94.4%
if -2.6e20 < z < 4.1e9Initial program 92.9%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in t around inf 85.5%
mul-1-neg85.5%
associate-*r/90.3%
distribute-lft-neg-out90.3%
*-commutative90.3%
Simplified90.3%
if 4.1e9 < z Initial program 72.4%
associate-*l/93.7%
Simplified93.7%
Taylor expanded in a around 0 68.8%
associate-/l*94.5%
Simplified94.5%
clear-num94.3%
associate-/r/94.5%
clear-num94.5%
Applied egg-rr94.5%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.3e+20) (not (<= z 4.3e-17))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.3e+20) || !(z <= 4.3e-17)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.3d+20)) .or. (.not. (z <= 4.3d-17))) then
tmp = x + y
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.3e+20) || !(z <= 4.3e-17)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.3e+20) or not (z <= 4.3e-17): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.3e+20) || !(z <= 4.3e-17)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.3e+20) || ~((z <= 4.3e-17))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.3e+20], N[Not[LessEqual[z, 4.3e-17]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+20} \lor \neg \left(z \leq 4.3 \cdot 10^{-17}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.3e20 or 4.30000000000000023e-17 < z Initial program 73.4%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in z around inf 85.3%
if -2.3e20 < z < 4.30000000000000023e-17Initial program 92.8%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in z around 0 76.5%
associate-/l*81.0%
associate-/r/81.0%
Simplified81.0%
Final simplification82.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.2e+20) (+ x y) (if (<= z 1.08e-16) (+ x (/ y (/ a t))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e+20) {
tmp = x + y;
} else if (z <= 1.08e-16) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.2d+20)) then
tmp = x + y
else if (z <= 1.08d-16) then
tmp = x + (y / (a / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e+20) {
tmp = x + y;
} else if (z <= 1.08e-16) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.2e+20: tmp = x + y elif z <= 1.08e-16: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.2e+20) tmp = Float64(x + y); elseif (z <= 1.08e-16) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.2e+20) tmp = x + y; elseif (z <= 1.08e-16) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.2e+20], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.08e-16], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+20}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{-16}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.2e20 or 1.08e-16 < z Initial program 73.4%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in z around inf 85.3%
if -2.2e20 < z < 1.08e-16Initial program 92.8%
associate-*l/97.3%
Simplified97.3%
add-cube-cbrt96.8%
pow396.8%
associate-*l/92.2%
associate-/l*98.0%
Applied egg-rr98.0%
rem-cube-cbrt98.6%
div-inv98.6%
associate-/r*97.3%
Applied egg-rr97.3%
Taylor expanded in z around 0 76.5%
*-commutative76.5%
associate-/l*81.6%
Simplified81.6%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((z - t) * (y / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - a)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{z - a}
\end{array}
Initial program 84.7%
associate-*l/96.1%
Simplified96.1%
Final simplification96.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -9.5e-41) (+ x y) (if (<= z 9.5e-51) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e-41) {
tmp = x + y;
} else if (z <= 9.5e-51) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-9.5d-41)) then
tmp = x + y
else if (z <= 9.5d-51) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e-41) {
tmp = x + y;
} else if (z <= 9.5e-51) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.5e-41: tmp = x + y elif z <= 9.5e-51: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.5e-41) tmp = Float64(x + y); elseif (z <= 9.5e-51) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9.5e-41) tmp = x + y; elseif (z <= 9.5e-51) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.5e-41], N[(x + y), $MachinePrecision], If[LessEqual[z, 9.5e-51], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-41}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -9.4999999999999997e-41 or 9.4999999999999998e-51 < z Initial program 77.5%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in z around inf 79.1%
if -9.4999999999999997e-41 < z < 9.4999999999999998e-51Initial program 92.2%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in t around 0 57.4%
associate-*l/58.9%
*-commutative58.9%
Simplified58.9%
Taylor expanded in x around inf 51.6%
Final simplification65.7%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 84.7%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in t around 0 62.6%
associate-*l/69.2%
*-commutative69.2%
Simplified69.2%
Taylor expanded in x around inf 53.1%
Final simplification53.1%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2023279
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))