
(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 12 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 (+ (* y (/ (- z t) (- z a))) x))
double code(double x, double y, double z, double t, double a) {
return (y * ((z - t) / (z - a))) + 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 = (y * ((z - t) / (z - a))) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y * ((z - t) / (z - a))) + x;
}
def code(x, y, z, t, a): return (y * ((z - t) / (z - a))) + x
function code(x, y, z, t, a) return Float64(Float64(y * Float64(Float64(z - t) / Float64(z - a))) + x) end
function tmp = code(x, y, z, t, a) tmp = (y * ((z - t) / (z - a))) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{z - t}{z - a} + x
\end{array}
Initial program 83.5%
+-commutative83.5%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
fma-undefine98.8%
Applied egg-rr98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 -4e+288) (not (<= t_1 2e+285)))
(/ y (/ (- z a) (- z t)))
(+ 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 <= -4e+288) || !(t_1 <= 2e+285)) {
tmp = y / ((z - a) / (z - t));
} 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 <= (-4d+288)) .or. (.not. (t_1 <= 2d+285))) then
tmp = y / ((z - a) / (z - t))
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 <= -4e+288) || !(t_1 <= 2e+285)) {
tmp = y / ((z - a) / (z - t));
} 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 <= -4e+288) or not (t_1 <= 2e+285): tmp = y / ((z - a) / (z - t)) 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 <= -4e+288) || !(t_1 <= 2e+285)) tmp = Float64(y / Float64(Float64(z - a) / Float64(z - t))); 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 <= -4e+288) || ~((t_1 <= 2e+285))) tmp = y / ((z - a) / (z - t)); 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, -4e+288], N[Not[LessEqual[t$95$1, 2e+285]], $MachinePrecision]], N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $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 -4 \cdot 10^{+288} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+285}\right):\\
\;\;\;\;\frac{y}{\frac{z - a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -4e288 or 2e285 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 32.0%
+-commutative32.0%
associate-/l*99.9%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 89.2%
div-sub89.2%
associate-*r/32.0%
associate-*l/87.5%
Simplified87.5%
associate-/r/89.2%
Applied egg-rr89.2%
if -4e288 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2e285Initial program 99.6%
Final simplification97.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.7e+84)
(+ y x)
(if (<= z 2.8e-23)
(+ x (* t (/ y a)))
(if (<= z 3.3e+70) (* (- z t) (/ y (- z a))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+84) {
tmp = y + x;
} else if (z <= 2.8e-23) {
tmp = x + (t * (y / a));
} else if (z <= 3.3e+70) {
tmp = (z - t) * (y / (z - a));
} else {
tmp = y + x;
}
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.7d+84)) then
tmp = y + x
else if (z <= 2.8d-23) then
tmp = x + (t * (y / a))
else if (z <= 3.3d+70) then
tmp = (z - t) * (y / (z - a))
else
tmp = y + x
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.7e+84) {
tmp = y + x;
} else if (z <= 2.8e-23) {
tmp = x + (t * (y / a));
} else if (z <= 3.3e+70) {
tmp = (z - t) * (y / (z - a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.7e+84: tmp = y + x elif z <= 2.8e-23: tmp = x + (t * (y / a)) elif z <= 3.3e+70: tmp = (z - t) * (y / (z - a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e+84) tmp = Float64(y + x); elseif (z <= 2.8e-23) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 3.3e+70) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.7e+84) tmp = y + x; elseif (z <= 2.8e-23) tmp = x + (t * (y / a)); elseif (z <= 3.3e+70) tmp = (z - t) * (y / (z - a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e+84], N[(y + x), $MachinePrecision], If[LessEqual[z, 2.8e-23], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+70], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+84}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-23}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+70}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.6999999999999999e84 or 3.30000000000000016e70 < z Initial program 69.1%
+-commutative69.1%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 83.7%
+-commutative83.7%
Simplified83.7%
if -1.6999999999999999e84 < z < 2.7999999999999997e-23Initial program 92.3%
+-commutative92.3%
associate-/l*97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in z around 0 76.1%
+-commutative76.1%
associate-/l*82.7%
Simplified82.7%
if 2.7999999999999997e-23 < z < 3.30000000000000016e70Initial program 90.1%
+-commutative90.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 70.5%
div-sub70.5%
associate-*r/60.7%
associate-*l/70.4%
Simplified70.4%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.4e+123) (not (<= z 5.2e+72))) (+ y x) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.4e+123) || !(z <= 5.2e+72)) {
tmp = y + x;
} else {
tmp = x + (y * (t / (a - 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 <= (-1.4d+123)) .or. (.not. (z <= 5.2d+72))) then
tmp = y + x
else
tmp = x + (y * (t / (a - 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 <= -1.4e+123) || !(z <= 5.2e+72)) {
tmp = y + x;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.4e+123) or not (z <= 5.2e+72): tmp = y + x else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.4e+123) || !(z <= 5.2e+72)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.4e+123) || ~((z <= 5.2e+72))) tmp = y + x; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.4e+123], N[Not[LessEqual[z, 5.2e+72]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+123} \lor \neg \left(z \leq 5.2 \cdot 10^{+72}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.40000000000000006e123 or 5.19999999999999963e72 < z Initial program 66.3%
+-commutative66.3%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 85.4%
+-commutative85.4%
Simplified85.4%
if -1.40000000000000006e123 < z < 5.19999999999999963e72Initial program 92.3%
Taylor expanded in t around inf 81.9%
mul-1-neg81.9%
distribute-neg-frac281.9%
associate-*r/87.6%
sub-neg87.6%
distribute-neg-in87.6%
remove-double-neg87.6%
Simplified87.6%
Taylor expanded in t around 0 81.9%
*-commutative81.9%
associate-/l*87.2%
Simplified87.2%
Final simplification86.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.06e+55) (not (<= t 4.3e+117))) (+ x (* y (/ t (- a z)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.06e+55) || !(t <= 4.3e+117)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (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 ((t <= (-2.06d+55)) .or. (.not. (t <= 4.3d+117))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (y * (z / (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 ((t <= -2.06e+55) || !(t <= 4.3e+117)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.06e+55) or not (t <= 4.3e+117): tmp = x + (y * (t / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.06e+55) || !(t <= 4.3e+117)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.06e+55) || ~((t <= 4.3e+117))) tmp = x + (y * (t / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.06e+55], N[Not[LessEqual[t, 4.3e+117]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.06 \cdot 10^{+55} \lor \neg \left(t \leq 4.3 \cdot 10^{+117}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -2.06e55 or 4.29999999999999998e117 < t Initial program 77.9%
Taylor expanded in t around inf 75.8%
mul-1-neg75.8%
distribute-neg-frac275.8%
associate-*r/89.5%
sub-neg89.5%
distribute-neg-in89.5%
remove-double-neg89.5%
Simplified89.5%
Taylor expanded in t around 0 75.8%
*-commutative75.8%
associate-/l*87.6%
Simplified87.6%
if -2.06e55 < t < 4.29999999999999998e117Initial program 87.1%
Taylor expanded in t around 0 77.1%
associate-/l*88.8%
Simplified88.8%
Final simplification88.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.5e+120) (+ x (* y (/ (- z t) z))) (if (<= z 4.9e+70) (+ x (* y (/ t (- a z)))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+120) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 4.9e+70) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (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 <= (-3.5d+120)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 4.9d+70) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (y * (z / (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 <= -3.5e+120) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 4.9e+70) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.5e+120: tmp = x + (y * ((z - t) / z)) elif z <= 4.9e+70: tmp = x + (y * (t / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e+120) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 4.9e+70) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.5e+120) tmp = x + (y * ((z - t) / z)); elseif (z <= 4.9e+70) tmp = x + (y * (t / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e+120], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.9e+70], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+120}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{+70}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -3.50000000000000007e120Initial program 61.9%
+-commutative61.9%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 61.6%
+-commutative61.6%
associate-/l*95.0%
Simplified95.0%
if -3.50000000000000007e120 < z < 4.90000000000000028e70Initial program 92.3%
Taylor expanded in t around inf 81.9%
mul-1-neg81.9%
distribute-neg-frac281.9%
associate-*r/87.6%
sub-neg87.6%
distribute-neg-in87.6%
remove-double-neg87.6%
Simplified87.6%
Taylor expanded in t around 0 81.9%
*-commutative81.9%
associate-/l*87.2%
Simplified87.2%
if 4.90000000000000028e70 < z Initial program 70.1%
Taylor expanded in t around 0 66.1%
associate-/l*92.4%
Simplified92.4%
Final simplification89.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.3e+122) (+ x (* y (/ (- z t) z))) (if (<= z 3.7e+72) (+ x (* t (/ y (- a z)))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+122) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 3.7e+72) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (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 <= (-1.3d+122)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 3.7d+72) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y * (z / (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 <= -1.3e+122) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 3.7e+72) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.3e+122: tmp = x + (y * ((z - t) / z)) elif z <= 3.7e+72: tmp = x + (t * (y / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e+122) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 3.7e+72) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.3e+122) tmp = x + (y * ((z - t) / z)); elseif (z <= 3.7e+72) tmp = x + (t * (y / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+122], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+72], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+122}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+72}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -1.30000000000000004e122Initial program 61.9%
+-commutative61.9%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 61.6%
+-commutative61.6%
associate-/l*95.0%
Simplified95.0%
if -1.30000000000000004e122 < z < 3.7000000000000002e72Initial program 92.3%
Taylor expanded in t around inf 81.9%
mul-1-neg81.9%
distribute-neg-frac281.9%
associate-*r/87.6%
sub-neg87.6%
distribute-neg-in87.6%
remove-double-neg87.6%
Simplified87.6%
if 3.7000000000000002e72 < z Initial program 70.1%
Taylor expanded in t around 0 66.1%
associate-/l*92.4%
Simplified92.4%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7e+14) (not (<= z 3.8e+26))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7e+14) || !(z <= 3.8e+26)) {
tmp = y + x;
} 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 <= (-7d+14)) .or. (.not. (z <= 3.8d+26))) then
tmp = y + x
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 <= -7e+14) || !(z <= 3.8e+26)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7e+14) or not (z <= 3.8e+26): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7e+14) || !(z <= 3.8e+26)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7e+14) || ~((z <= 3.8e+26))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7e+14], N[Not[LessEqual[z, 3.8e+26]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+14} \lor \neg \left(z \leq 3.8 \cdot 10^{+26}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -7e14 or 3.8000000000000002e26 < z Initial program 72.0%
+-commutative72.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.4%
+-commutative78.4%
Simplified78.4%
if -7e14 < z < 3.8000000000000002e26Initial program 93.8%
Taylor expanded in z around 0 74.1%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7e+81) (not (<= z 3.9e+20))) (+ y x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7e+81) || !(z <= 3.9e+20)) {
tmp = y + x;
} else {
tmp = x + (t * (y / 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 <= (-7d+81)) .or. (.not. (z <= 3.9d+20))) then
tmp = y + x
else
tmp = x + (t * (y / 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 <= -7e+81) || !(z <= 3.9e+20)) {
tmp = y + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7e+81) or not (z <= 3.9e+20): tmp = y + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7e+81) || !(z <= 3.9e+20)) tmp = Float64(y + x); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7e+81) || ~((z <= 3.9e+20))) tmp = y + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7e+81], N[Not[LessEqual[z, 3.9e+20]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+81} \lor \neg \left(z \leq 3.9 \cdot 10^{+20}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -7.0000000000000001e81 or 3.9e20 < z Initial program 70.7%
+-commutative70.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -7.0000000000000001e81 < z < 3.9e20Initial program 92.9%
+-commutative92.9%
associate-/l*98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in z around 0 73.6%
+-commutative73.6%
associate-/l*79.6%
Simplified79.6%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.7e+150) x (if (<= a 4.5e+199) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7e+150) {
tmp = x;
} else if (a <= 4.5e+199) {
tmp = y + x;
} else {
tmp = x;
}
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 (a <= (-2.7d+150)) then
tmp = x
else if (a <= 4.5d+199) then
tmp = y + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7e+150) {
tmp = x;
} else if (a <= 4.5e+199) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.7e+150: tmp = x elif a <= 4.5e+199: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.7e+150) tmp = x; elseif (a <= 4.5e+199) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.7e+150) tmp = x; elseif (a <= 4.5e+199) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.7e+150], x, If[LessEqual[a, 4.5e+199], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+150}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{+199}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.70000000000000008e150 or 4.4999999999999997e199 < a Initial program 77.4%
+-commutative77.4%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 68.4%
if -2.70000000000000008e150 < a < 4.4999999999999997e199Initial program 85.1%
+-commutative85.1%
associate-/l*98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in z around inf 63.8%
+-commutative63.8%
Simplified63.8%
Final simplification64.8%
(FPCore (x y z t a) :precision binary64 (if (<= y 3.7e+93) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 3.7e+93) {
tmp = x;
} else {
tmp = 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 (y <= 3.7d+93) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 3.7e+93) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 3.7e+93: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 3.7e+93) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 3.7e+93) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 3.7e+93], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.7 \cdot 10^{+93}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 3.69999999999999987e93Initial program 90.0%
+-commutative90.0%
associate-/l*98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in y around 0 56.8%
if 3.69999999999999987e93 < y Initial program 55.0%
+-commutative55.0%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 86.0%
div-sub86.0%
associate-*r/46.9%
associate-*l/81.8%
Simplified81.8%
Taylor expanded in z around inf 54.2%
Taylor expanded in z around inf 39.0%
Final simplification53.5%
(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 83.5%
+-commutative83.5%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in y around 0 48.6%
Final simplification48.6%
(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 2024079
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))