
(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 14 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 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 82.6%
+-commutative82.6%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (<= t_1 (- INFINITY))
(+ x (* y (- 1.0 (/ t z))))
(if (<= t_1 1e+274) (+ x t_1) (+ x (* t (/ y (- a z))))))))
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 <= -((double) INFINITY)) {
tmp = x + (y * (1.0 - (t / z)));
} else if (t_1 <= 1e+274) {
tmp = x + t_1;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) {
tmp = x + (y * (1.0 - (t / z)));
} else if (t_1 <= 1e+274) {
tmp = x + t_1;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if t_1 <= -math.inf: tmp = x + (y * (1.0 - (t / z))) elif t_1 <= 1e+274: tmp = x + t_1 else: tmp = x + (t * (y / (a - z))) 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 <= Float64(-Inf)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif (t_1 <= 1e+274) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); 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 <= -Inf) tmp = x + (y * (1.0 - (t / z))); elseif (t_1 <= 1e+274) tmp = x + t_1; else tmp = x + (t * (y / (a - z))); 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, (-Infinity)], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+274], N[(x + t$95$1), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $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 -\infty:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+274}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0Initial program 33.2%
Taylor expanded in a around 0 23.3%
associate-/l*84.1%
div-sub84.1%
*-inverses84.1%
Simplified84.1%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.99999999999999921e273Initial program 99.9%
if 9.99999999999999921e273 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 28.7%
+-commutative28.7%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
fma-undefine99.8%
associate-/l*28.7%
div-inv28.7%
*-commutative28.7%
associate-*r*99.5%
div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 67.4%
neg-mul-167.4%
Simplified67.4%
Taylor expanded in t around 0 33.2%
mul-1-neg33.2%
associate-*r/67.4%
sub-neg67.4%
Simplified67.4%
Final simplification93.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -135000000000.0)
(+ y x)
(if (<= z 1.3e-47)
(+ x (* t (/ y a)))
(if (<= z 5.6e+151) (- x (* t (/ y z))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -135000000000.0) {
tmp = y + x;
} else if (z <= 1.3e-47) {
tmp = x + (t * (y / a));
} else if (z <= 5.6e+151) {
tmp = x - (t * (y / z));
} 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 <= (-135000000000.0d0)) then
tmp = y + x
else if (z <= 1.3d-47) then
tmp = x + (t * (y / a))
else if (z <= 5.6d+151) then
tmp = x - (t * (y / z))
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 <= -135000000000.0) {
tmp = y + x;
} else if (z <= 1.3e-47) {
tmp = x + (t * (y / a));
} else if (z <= 5.6e+151) {
tmp = x - (t * (y / z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -135000000000.0: tmp = y + x elif z <= 1.3e-47: tmp = x + (t * (y / a)) elif z <= 5.6e+151: tmp = x - (t * (y / z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -135000000000.0) tmp = Float64(y + x); elseif (z <= 1.3e-47) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 5.6e+151) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -135000000000.0) tmp = y + x; elseif (z <= 1.3e-47) tmp = x + (t * (y / a)); elseif (z <= 5.6e+151) tmp = x - (t * (y / z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -135000000000.0], N[(y + x), $MachinePrecision], If[LessEqual[z, 1.3e-47], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+151], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -135000000000:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-47}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+151}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.35e11 or 5.59999999999999975e151 < z Initial program 70.0%
+-commutative70.0%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 85.1%
+-commutative85.1%
Simplified85.1%
if -1.35e11 < z < 1.3e-47Initial program 94.2%
+-commutative94.2%
associate-/l*97.1%
fma-define97.1%
Simplified97.1%
Taylor expanded in z around 0 72.1%
+-commutative72.1%
associate-/l*76.3%
Simplified76.3%
if 1.3e-47 < z < 5.59999999999999975e151Initial program 87.2%
+-commutative87.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
fma-undefine99.9%
associate-/l*87.2%
div-inv87.2%
*-commutative87.2%
associate-*r*99.9%
div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 84.1%
neg-mul-184.1%
Simplified84.1%
Taylor expanded in z around inf 72.6%
mul-1-neg72.6%
unsub-neg72.6%
associate-/l*74.9%
Simplified74.9%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.5e-10) (+ y x) (if (<= z 2.15e-294) x (if (<= z 7.6e-79) (* y (/ t a)) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e-10) {
tmp = y + x;
} else if (z <= 2.15e-294) {
tmp = x;
} else if (z <= 7.6e-79) {
tmp = y * (t / 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 <= (-5.5d-10)) then
tmp = y + x
else if (z <= 2.15d-294) then
tmp = x
else if (z <= 7.6d-79) then
tmp = y * (t / 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 <= -5.5e-10) {
tmp = y + x;
} else if (z <= 2.15e-294) {
tmp = x;
} else if (z <= 7.6e-79) {
tmp = y * (t / a);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e-10: tmp = y + x elif z <= 2.15e-294: tmp = x elif z <= 7.6e-79: tmp = y * (t / a) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e-10) tmp = Float64(y + x); elseif (z <= 2.15e-294) tmp = x; elseif (z <= 7.6e-79) tmp = Float64(y * Float64(t / a)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e-10) tmp = y + x; elseif (z <= 2.15e-294) tmp = x; elseif (z <= 7.6e-79) tmp = y * (t / a); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e-10], N[(y + x), $MachinePrecision], If[LessEqual[z, 2.15e-294], x, If[LessEqual[z, 7.6e-79], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-10}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-294}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-79}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -5.4999999999999996e-10 or 7.6000000000000002e-79 < z Initial program 76.0%
+-commutative76.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 74.9%
+-commutative74.9%
Simplified74.9%
if -5.4999999999999996e-10 < z < 2.1500000000000001e-294Initial program 94.6%
+-commutative94.6%
associate-/l*96.4%
fma-define96.4%
Simplified96.4%
Taylor expanded in y around 0 56.6%
if 2.1500000000000001e-294 < z < 7.6000000000000002e-79Initial program 96.8%
+-commutative96.8%
associate-/l*96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in a around inf 92.3%
mul-1-neg92.3%
unsub-neg92.3%
associate-/l*89.3%
Simplified89.3%
clear-num89.3%
un-div-inv92.5%
Applied egg-rr92.5%
Taylor expanded in x around 0 60.3%
mul-1-neg60.3%
associate-/l*60.4%
distribute-rgt-neg-in60.4%
distribute-neg-frac260.4%
Simplified60.4%
Taylor expanded in z around 0 59.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.00385) (not (<= t 96000000000000.0))) (+ 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 ((t <= -0.00385) || !(t <= 96000000000000.0)) {
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 ((t <= (-0.00385d0)) .or. (.not. (t <= 96000000000000.0d0))) 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 ((t <= -0.00385) || !(t <= 96000000000000.0)) {
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 (t <= -0.00385) or not (t <= 96000000000000.0): 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 ((t <= -0.00385) || !(t <= 96000000000000.0)) 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 ((t <= -0.00385) || ~((t <= 96000000000000.0))) 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[Or[LessEqual[t, -0.00385], N[Not[LessEqual[t, 96000000000000.0]], $MachinePrecision]], 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}\;t \leq -0.00385 \lor \neg \left(t \leq 96000000000000\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -0.0038500000000000001 or 9.6e13 < t Initial program 81.8%
+-commutative81.8%
associate-/l*97.6%
fma-define97.6%
Simplified97.6%
fma-undefine97.6%
associate-/l*81.8%
div-inv81.7%
*-commutative81.7%
associate-*r*99.0%
div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in z around 0 90.5%
neg-mul-190.5%
Simplified90.5%
Taylor expanded in t around 0 80.9%
mul-1-neg80.9%
associate-*r/90.5%
sub-neg90.5%
Simplified90.5%
if -0.0038500000000000001 < t < 9.6e13Initial program 83.4%
Taylor expanded in t around 0 75.2%
associate-/l*91.7%
Simplified91.7%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e-104) (not (<= z 9.5e+42))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e-104) || !(z <= 9.5e+42)) {
tmp = x + (y * (1.0 - (t / z)));
} 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 <= (-4.5d-104)) .or. (.not. (z <= 9.5d+42))) then
tmp = x + (y * (1.0d0 - (t / z)))
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 <= -4.5e-104) || !(z <= 9.5e+42)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e-104) or not (z <= 9.5e+42): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e-104) || !(z <= 9.5e+42)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); 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 <= -4.5e-104) || ~((z <= 9.5e+42))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e-104], N[Not[LessEqual[z, 9.5e+42]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-104} \lor \neg \left(z \leq 9.5 \cdot 10^{+42}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -4.4999999999999997e-104 or 9.50000000000000019e42 < z Initial program 76.8%
Taylor expanded in a around 0 66.9%
associate-/l*85.4%
div-sub85.4%
*-inverses85.4%
Simplified85.4%
if -4.4999999999999997e-104 < z < 9.50000000000000019e42Initial program 93.5%
+-commutative93.5%
associate-/l*96.7%
fma-define96.7%
Simplified96.7%
Taylor expanded in z around 0 76.6%
+-commutative76.6%
associate-/l*81.4%
Simplified81.4%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.3e+189) (* t (/ y (- a z))) (if (<= t 9.5e+27) (+ x (* y (/ z (- z a)))) (+ x (* (- z t) (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.3e+189) {
tmp = t * (y / (a - z));
} else if (t <= 9.5e+27) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + ((z - t) * (y / 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 (t <= (-3.3d+189)) then
tmp = t * (y / (a - z))
else if (t <= 9.5d+27) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + ((z - t) * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.3e+189) {
tmp = t * (y / (a - z));
} else if (t <= 9.5e+27) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + ((z - t) * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.3e+189: tmp = t * (y / (a - z)) elif t <= 9.5e+27: tmp = x + (y * (z / (z - a))) else: tmp = x + ((z - t) * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.3e+189) tmp = Float64(t * Float64(y / Float64(a - z))); elseif (t <= 9.5e+27) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.3e+189) tmp = t * (y / (a - z)); elseif (t <= 9.5e+27) tmp = x + (y * (z / (z - a))); else tmp = x + ((z - t) * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.3e+189], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+27], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+189}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+27}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\end{array}
\end{array}
if t < -3.3000000000000002e189Initial program 75.2%
+-commutative75.2%
associate-/l*95.7%
fma-define95.7%
Simplified95.7%
fma-undefine95.7%
associate-/l*75.2%
div-inv75.1%
*-commutative75.1%
associate-*r*95.6%
div-inv95.7%
Applied egg-rr95.7%
Taylor expanded in z around 0 91.4%
neg-mul-191.4%
Simplified91.4%
Taylor expanded in t around 0 75.0%
mul-1-neg75.0%
associate-*r/91.4%
sub-neg91.4%
Simplified91.4%
Taylor expanded in x around 0 57.8%
mul-1-neg57.8%
associate-/l*74.4%
distribute-rgt-neg-in74.4%
distribute-frac-neg74.4%
Simplified74.4%
if -3.3000000000000002e189 < t < 9.4999999999999997e27Initial program 83.1%
Taylor expanded in t around 0 72.6%
associate-/l*88.8%
Simplified88.8%
if 9.4999999999999997e27 < t Initial program 84.0%
+-commutative84.0%
associate-/l*97.0%
fma-define97.0%
Simplified97.0%
fma-undefine97.0%
associate-/l*84.0%
div-inv84.0%
*-commutative84.0%
associate-*r*99.6%
div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 75.6%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -215000000000.0) (+ x (* y (/ z (- z a)))) (if (<= a 3.5e+53) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -215000000000.0) {
tmp = x + (y * (z / (z - a)));
} else if (a <= 3.5e+53) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t / (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) :: tmp
if (a <= (-215000000000.0d0)) then
tmp = x + (y * (z / (z - a)))
else if (a <= 3.5d+53) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (t / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -215000000000.0) {
tmp = x + (y * (z / (z - a)));
} else if (a <= 3.5e+53) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -215000000000.0: tmp = x + (y * (z / (z - a))) elif a <= 3.5e+53: tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -215000000000.0) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (a <= 3.5e+53) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -215000000000.0) tmp = x + (y * (z / (z - a))); elseif (a <= 3.5e+53) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -215000000000.0], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e+53], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -215000000000:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+53}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if a < -2.15e11Initial program 77.2%
Taylor expanded in t around 0 66.7%
associate-/l*81.4%
Simplified81.4%
if -2.15e11 < a < 3.50000000000000019e53Initial program 84.0%
Taylor expanded in a around 0 70.4%
associate-/l*85.5%
div-sub85.5%
*-inverses85.5%
Simplified85.5%
if 3.50000000000000019e53 < a Initial program 85.2%
+-commutative85.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around 0 70.2%
+-commutative70.2%
associate-/l*82.8%
Simplified82.8%
clear-num82.8%
un-div-inv82.8%
Applied egg-rr82.8%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -70000000000.0) (not (<= z 3.1e+141))) (+ y x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -70000000000.0) || !(z <= 3.1e+141)) {
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 <= (-70000000000.0d0)) .or. (.not. (z <= 3.1d+141))) 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 <= -70000000000.0) || !(z <= 3.1e+141)) {
tmp = y + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -70000000000.0) or not (z <= 3.1e+141): tmp = y + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -70000000000.0) || !(z <= 3.1e+141)) 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 <= -70000000000.0) || ~((z <= 3.1e+141))) tmp = y + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -70000000000.0], N[Not[LessEqual[z, 3.1e+141]], $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 -70000000000 \lor \neg \left(z \leq 3.1 \cdot 10^{+141}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -7e10 or 3.10000000000000004e141 < z Initial program 70.0%
+-commutative70.0%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 84.6%
+-commutative84.6%
Simplified84.6%
if -7e10 < z < 3.10000000000000004e141Initial program 92.6%
+-commutative92.6%
associate-/l*97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in z around 0 68.5%
+-commutative68.5%
associate-/l*73.1%
Simplified73.1%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.1e-10) (not (<= z 1.15e-17))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.1e-10) || !(z <= 1.15e-17)) {
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 <= (-4.1d-10)) .or. (.not. (z <= 1.15d-17))) 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 <= -4.1e-10) || !(z <= 1.15e-17)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.1e-10) or not (z <= 1.15e-17): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.1e-10) || !(z <= 1.15e-17)) 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 <= -4.1e-10) || ~((z <= 1.15e-17))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.1e-10], N[Not[LessEqual[z, 1.15e-17]], $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 -4.1 \cdot 10^{-10} \lor \neg \left(z \leq 1.15 \cdot 10^{-17}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -4.0999999999999998e-10 or 1.15000000000000004e-17 < z Initial program 74.5%
+-commutative74.5%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -4.0999999999999998e-10 < z < 1.15000000000000004e-17Initial program 95.1%
Taylor expanded in z around 0 72.9%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.8e+226) x (if (<= a 3.4e+230) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e+226) {
tmp = x;
} else if (a <= 3.4e+230) {
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 <= (-1.8d+226)) then
tmp = x
else if (a <= 3.4d+230) 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 <= -1.8e+226) {
tmp = x;
} else if (a <= 3.4e+230) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.8e+226: tmp = x elif a <= 3.4e+230: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.8e+226) tmp = x; elseif (a <= 3.4e+230) 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 <= -1.8e+226) tmp = x; elseif (a <= 3.4e+230) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.8e+226], x, If[LessEqual[a, 3.4e+230], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+226}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{+230}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.7999999999999999e226 or 3.39999999999999986e230 < a Initial program 81.5%
+-commutative81.5%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around 0 79.1%
if -1.7999999999999999e226 < a < 3.39999999999999986e230Initial program 82.8%
+-commutative82.8%
associate-/l*98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in z around inf 65.4%
+-commutative65.4%
Simplified65.4%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.2e-128) x (if (<= x 8.8e-38) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.2e-128) {
tmp = x;
} else if (x <= 8.8e-38) {
tmp = y;
} 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 (x <= (-1.2d-128)) then
tmp = x
else if (x <= 8.8d-38) then
tmp = y
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 (x <= -1.2e-128) {
tmp = x;
} else if (x <= 8.8e-38) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.2e-128: tmp = x elif x <= 8.8e-38: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.2e-128) tmp = x; elseif (x <= 8.8e-38) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.2e-128) tmp = x; elseif (x <= 8.8e-38) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.2e-128], x, If[LessEqual[x, 8.8e-38], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-128}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{-38}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.1999999999999999e-128 or 8.80000000000000029e-38 < x Initial program 85.6%
+-commutative85.6%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 71.4%
if -1.1999999999999999e-128 < x < 8.80000000000000029e-38Initial program 77.3%
+-commutative77.3%
associate-/l*96.7%
fma-define96.7%
Simplified96.7%
Taylor expanded in z around inf 46.3%
+-commutative46.3%
Simplified46.3%
Taylor expanded in y around inf 35.4%
(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 82.6%
+-commutative82.6%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
fma-undefine98.8%
associate-/l*82.6%
div-inv82.6%
*-commutative82.6%
associate-*r*97.5%
div-inv97.5%
Applied egg-rr97.5%
Final simplification97.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 82.6%
+-commutative82.6%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in y around 0 52.0%
(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 2024139
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))